Bienvenido a Tecnohackers

Tecnohackers » Hacking y Seguridad » Hacking » Herramientas Hacking
 » 

Gen2k - Generador automático de lista de palabras



Autor Tema: Gen2k - Generador automático de lista de palabras  (Leído 2525 veces)

Desconectado zolo

  • Consigliere
  • Master
  • *****
  • Mensajes: 23165
  • Un Mes, Un Año o Toda Una Vida, Da Igual, Estare
Gen2k - Generador automático de lista de palabras
« en: Octubre 29, 2015, 07:59:36 am »
WordList, es como una lista de posibles contraseñas que se pueden utilizar para romper hashes con realizar ataques de fuerza bruta sobre diversos protocolos y se pueden usar para cualquier cracking en general.

En realidad no es necesario generar uno propio debido a que ya existen algunas wordlists que se encuentra en la web. Pero hay veces en que se desearía un wordList personalizado para afinar tus ataques; especialmente si conoces bien el blanco. En tales casos, automaticamente el generador de WordList puede ser útil ya que le permite hacer conjeturas acerca de lo que la contraseña puede ser y no sólo fuerza bruta con lista de palabras irrelevantes totalmente al azar

Gen2k está todavía en beta, pero funciona a la perfección a partir de ahora. No es tu tipico generador de lista de palabras , y no pretende serlo. Ya hay buenos por ahí como Crunch, etc.

Gen2k pretende ser un inteligente generador de lista de palabras, se necesitan palabras de la muestra como entrada. Ejemplos de palabras pueden ser cualquier cosa que usted sabe sobre el objetivo, de la zona, fecha de nacimiento con nombres y eventos especiales, etc. Una vez que una lista de todas esas palabras conocidas se han suministrado a Gen2k, automáticamente, en función de las opciones configuradas .. determina la mejor manera posible para hacer una lista de palabras de aquellos. Como muchos de ustedes saben, la gente tiende a usar años del nacimiento, las fechas específicas, números aleatorios, palabras especializado adjunto a las palabras simples con el fin de hacer que sus contraseñas más complejas. Gen2k pretende explotar ese tipo de debilidades, junto con la conversión de las palabras a los casos superior e inferior para hacer su lista de palabras totalmente personalizada y apropiado para la situación

Características:

* Genera combinaciones de contraseñas mediante la combinación de las palabras proporcionadas.
* Frecuentemente usa mezcla de patrones numéricos con palabras.
* Genera combinaciones de contraseñas utilizando año / fecha.
* Mezclas de usuario personalizado definido con combinación de valores con palabras.
* Opción para auto convertir palabras a mayúsculas / minúsculas y mayúsculas.
* WPA / WPA2 comprobación de validación de contraseña.
* No hay dependencias externas.

Código: You are not allowed to view links. Register or Login
#!/usr/bin/env python

__author__    = 'irenicus09'
__email__     = 'irenicus09[at]gmail[dot]com'
__license__   = 'BSD'
__version__   = 'BETA'
__date__      = '18/05/2013'

import sys


"""
##############################  GEN2K  ####################################

                    Automated Word List Generator

> Generates passwords combinations by combining words from wordlist.
> Covers frequently used number patterns used along with words.
> Generates passwords combinations using year/date combo.
> Generates custom user defined value(s) combination with word list.
> Option to auto convert words to upper/lowercase & capitalisation.
> WPA/WPA2 password validation check.
> No external dependencies.

---------------------------------------------------------------------------

                            HINTS:

  * DO NOT USE A GENERAL PURPOSE WORDLIST
  * SUPPLIED WORDLIST MUST ONLY CONTAIN KNOWN FACTS ABOUT TARGET
    E.G NAMES, ADDRESS, FAVORITE ARTIST, PLACE, EVENT, ETC.
  * TRY TO KEEP WORDLIST AT A MINIMUM, DON'T INCLUDE TOO MUCH DETAILS
  * THE FINAL GENERATED WORD LIST CAN GET EXTREMELY LARGE!

###########################################################################
"""


def help():
    print """


         ######   ######## ##    ##  #######  ##    ##
        ##    ##  ##       ###   ## ##     ## ##   ##
        ##        ##       ####  ##        ## ##  ##
        ##   #### ######   ## ## ##  #######  #####
        ##    ##  ##       ##  #### ##        ##  ##
        ##    ##  ##       ##   ### ##        ##   ##
         ######   ######## ##    ## ######### ##    ## 

         ======= Automated Word List Generator =======

                Copyright (C) irenicus09 2013


    USAGE: ./gen2k.py -w <wordlist> -o <output> [options]

    [ -c ] Enable word combination among the words in wordlist.

    [ -d ] Custom comma separated values to combine with wordlist.

    [ -e ] Enable wpa/wpa2 fitness check for generated passwords.

    [ -h ] Prints this help.

    [ -n ] Enable frequently used number combination with wordlist.

    [ -o ] Output filename.

    [ -w ] Path to word list file.
           Wordlist must contain info related to Target.

    [ -y ] Enable year combination with wordlist.

    [ -z ] Enable conversion of words to upper & lower case letters.

           Note: Conversion to upper/lowercase & capitalisation
           takes place before other modes are applied to the original list.

    """ % __version__



def main():

    if exist('-h'):
        help()
        sys.exit(0)

    if not (exist('-w') or exist('-o')):
        help()
        sys.exit(1)

    master_list = load_words(find('-w')) # List supplied by user

    data = [] # Final wordlist
    temp = [] # Temporary wordlist

    if exist('-z'):
        master_list = gen_case(master_list)
        data = master_list

    if exist('-c'):
        temp = gen_word_combo(master_list)
        data = list(set(temp+data))

    if exist('-n'):
        temp = gen_numbers(master_list)
        data = list(set(temp+data))

    if exist('-y'):
        temp = gen_year(master_list)
        data = list(set(temp+data))

    if exist('-d'):
        try:
            custom_values = find('-d').split(',')
        except (AttributeError):
            print '[!] Are you kidding me with no values?'
            sys.exit(1)

        temp = gen_custom(master_list, custom_values)
        data = list(set(temp+data))

    if exist('-e'):
        data = wpa_validation_check(data)

    write_file(find('-o'), data)

    print '[*] Total words generated: %d' % (len(data))

    sys.exit(0)


def merge_list(temp_list=[], final_list=[]):
    """
    Merges contents from temp_list (1st param) with final_list (2nd param)
    """
    for word in temp_list:
        if word not in final_list:
            final_list.append(word)


def load_words(path_to_file):
    """
    Function to fetch all possible words.
    """
    data = []

    try:
        handle = open(path_to_file, 'r')
        temp_list = handle.readlines()
        handle.close()

    except(BaseException):
        print '[!] Error occured while reading wordlist.'
        sys.exit(1)

    for word in temp_list:
        word = word.strip()
        if word != '':
            data.append(word)

    return data



def write_file(path_to_file, data=[]):
    """
    Writing to specified file.
    """
    try:
        handle = open(path_to_file, 'wb+')

        for word in data:
            handle.write(word+'\n')

        handle.close()
    except(BaseException):
        print '[!] Error occured while writing to file.'
        sys.exit(1)



def gen_case(words=[]):
    """
    Function to change words to Upper & Lower case.
    """
    custom_list = []

    for x in words:
        custom_list.append(x.lower())
        custom_list.append(x.capitalize())
        custom_list.append(x.upper())

    return list(set(custom_list))



def gen_numbers(words=[]):
    """
    Function to mix words with commonly used numbers patterns.
    """
    word_list = []

    if len(words) <= 0:
        return word_list

    num_list = ['0', '01', '012', '0123', '01234', '012345', '0123456', '01234567', '012345678', '0123456789',
    '1', '12', '123', '1234','12345', '123456','1234567','12345678','123456789', '1234567890', '9876543210',
    '987654321', '87654321', '7654321', '654321', '54321', '4321', '321', '21']

    for word in words:
        for num in num_list:
            word_list.append((word+num))
            word_list.append((num+word))

    return word_list




def gen_year(words=[]):
    """
    Function to mix auto generated year with words from wordlist.

    Hint: Date of birth & special dates are often
          combined with certain words to form
          passwords.
    """
    word_list = []

    if len(words) <= 0:
        return word_list

    # Double digit dates
    start = 1
    while(start <= 99):
        for word in words:
            word_list.append(word + str("%02d") % (start))
            word_list.append(str("%02d") % start + word)
        start += 1

    # Four digit dates
    start = 1900
    while (start <= 2020):
        for word in words:
            word_list.append(word+str(start))
            word_list.append(str(start)+word)
        start += 1

    return word_list




def gen_word_combo(words=[]):
    """
    Function to mix multiple words from given list.
    """
    word_list = []

    if len(words) <= 1:
        return word_list

    for word in words:
        for second_word in words:
            if word != second_word:
                word_list.append(second_word+word)

    return word_list




def gen_custom(words=[], data=[]):
    """
    Funtion to combine user defined input with wordlist.

    > Takes a comma separated list via cmdline as values.
    """
    word_list = []

    if (len(words) <= 0 or len(data) <= 0):
        return word_list

    for item in data:
        for word in words:
            word_list.append(item+word)
            word_list.append(word+item)

    return word_list



def wpa_validation_check(words=[]):
    """
    Function to optimise wordlist for wpa cracking

    > Removes Duplicates.
    > Removes passwords < 8 or > 63 characters in length.
    """
    custom_list =  list(set(words))
    custom_list = [x for x in custom_list if not (len(x) < 8 or len(x) > 63)]

    return custom_list


# S3my0n's argument parsers, thx brah :)
def find(flag):
    try:
        a = sys.argv[sys.argv.index(flag)+1]
    except (IndexError, ValueError):
        return None
    else:
        return a

def exist(flag):
    if flag in sys.argv[1:]:
        return True
    else:
        return False

if __name__ == '__main__':
    main()
 

You are not allowed to view links. Register or Login



You are not allowed to view links. Register or Login
« Última modificación: Octubre 29, 2015, 08:01:12 am por zolo »
You are not allowed to view links. Register or Login

Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal