Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import argparse
- import configparser
- import csv
- import ftplib
- import functools
- import gzip
- import os
- import sys
- from urllib.request import urlopen
- from time import sleep
- BANNER = """
- \033[1;36m\033[1;m ██╗ ██╗██████╗ █████╗ ██╗ ██╗███████╗███╗ ██╗
- \033[1;36m\033[1;m ██║ ██╔╝██╔══██╗██╔══██╗██║ ██╔╝██╔════╝████╗ ██║
- \033[1;36m\033[1;m █████╔╝ ██████╔╝███████║█████╔╝ █████╗ ██╔██╗ ██║
- \033[1;36m\033[1;m ██╔═██╗ ██╔══██╗██╔══██║██╔═██╗ ██╔══╝ ██║╚██╗██║
- \033[1;36m\033[1;m ██║ ██╗██║ ██║██║ ██║██║ ██╗███████╗██║ ╚████║
- \033[1;36m\033[1;m ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
- \033[1;32m\033[1;m Kraken Password Cracker && Wordlist Generator
- """
- print(BANNER)
- try:
- import readline
- except ImportError:
- print(ImportError)
- pass
- CFG = {}
- FTP_CFG = {}
- HS_CFG = {}
- def main():
- # CLI
- args = get_parser().parse_args()
- read_cfg()
- if not args.quiet:
- print(BANNER)
- if args.interactive:
- heatseeker()
- elif args.download_wordlist:
- dl_wlist()
- elif args.alecto:
- dl_adb()
- elif args.improve:
- dict_import(args.improve)
- def get_parser():
- # RETURN AN ARGUMENT PARSER; TRIGGERED VIA main() FUNCTION
- parser = argparse.ArgumentParser(description='KRAKEN')
- group = parser.add_mutually_exclusive_group(required=True)
- # LAUNCH HEATSEAKER MODE; MORE ADVANCED OPTIONS. MUST MODIFY SCRIPT; READ COMMENTS
- group.add_argument('-m', '--heatseeker-mode', action='store_true',
- help='Enter active target profile mode')
- # IMPROVE DICTIONARY
- group.add_argument('-w', dest='improve', metavar='FILENAME',
- help='Improve an existing dictionary'
- ' or WyD.pl output to make a more powerful wordlist')
- # DOWNLOAD WORDLIST
- group.add_argument('-d', dest='download_wordlist',
- action='store_true', help='Download lists from a repository')
- # ALECTO DATABASE
- group.add_argument('-a', action='store_true', help='Parse default username and passwords directly'
- ' from Alecto Database. Project Alecto uses purified'
- ' databases of Phenoelit and CIRT; merged && enhanced')
- # STEALTH MODE
- group.add_argument('-s', '--go-dark', action='store_true', help="Activate stealth mode; will not print banner")
- return parser
- def read_cfg(file='kraken.cfg'):
- # READ CFG FILE
- global cfg
- cfg = configparser.ConfigParser()
- cfg.read(file)
- CFG.update({
- 'years': cfg.get('years', 'years').split(','),
- 'chars': cfg.get('special_chars', 'chars').split(','),
- 'nums_from': cfg.getint('nums', 'from'),
- 'nums_to': cfg.getint('nums', 'to'),
- 'wc_from': cfg.getint('nums', 'wc_from'),
- 'wc_to': cfg.getint('nums', 'wc_to'),
- 'threshold': cfg.getint('nums', 'threshold'),
- 'alectourl': cfg.get('alecto', 'alectourl')
- })
- # HEATSEEKER MODE CONFIGURATION; LEAVE ALONE IF DON'T KNOW WHAT YOU DOING
- heatseeker = functools.partial(cfg.get, 'heatseeker')
- HS_CFG.update(dict(a=heatseeker('a'), e=heatseeker('e'), g=heatseeker('g'), i=heatseeker('i'),
- o=heatseeker('o'), s=heatseeker('s'), t=heatseeker('t'), z=heatseeker('z')))
- ftp_cfg = functools.partial(cfg.get, 'downloader')
- FTP_CFG.update(dict(name=ftp_cfg('ftpname'), url=ftp_cfg('ftpurl'), path=ftp_cfg('ftppath'),
- user=ftp_cfg('ftpuser'), password=ftp_cfg('ftppass')))
- def heatseeker():
- print(' ')
- print("[+] Loading HeatSeeker module. Initiating KRAKEN active target profiling mode... Please wait...")
- sleep(2)
- print(">>> Please enter the following information about the victim to make a personalized dictionary wordlist...")
- sleep(1)
- print("[!] If you do not know the information being asked, simply press enter to skip the question.\n")
- sleep(2)
- print(' ')
- tn = input(">>> First Name of the Target: ").lower().strip()
- while not tn:
- print("\n[x] You must enter the Target's name.", file=sys.stderr)
- tn = input(">>> First Name of the Target: ").lower().strip()
- ln = input(">>> Last Name: ").lower()
- nn = input(">>> Nickname or Alias: ").lower()
- tb = input(">>> Birthdate, formatted as 'DDMMYYYY': ").strip()
- while len(tb) not in (0, 8):
- print("\n[x] The Target's Birthdate must be comprised of 8 digits.", file=sys.stderr)
- tb = input(">>> Birthdate, formatted as 'DDMMYYYY': ").strip()
- print(' ')
- p = input("[+] Partner's Name: ").lower()
- pn = input(">>> Partner's Nickname or Alias").lower()
- pb = input(">>> Partner's Birthdate, formatted as DDMMYYYY: ").strip()
- while len(pb) not in (0, 8):
- print("\n[x] Partner's Birthdate must be comprised of 8 digits.", file=sys.stderr)
- pb = input(">>> Partner's Birthdate, formatted as 'DDMMYYYY': ").strip()
- print(' ')
- k = input("[+] Child's First Name: ").lower()
- kn = input(">>> Child's Nickname or Alias: ").lower()
- kb = input(">>> Childs Birthdate, formated as 'DDMMYYYY: ").strip()
- while len(kb) not in (0, 8):
- print("\n[x] Child's's Birthdate must be comprised of 8 digits.", file=sys.stderr)
- kb = input(">>> Partner's Birthdate, formatted as 'DDMMYYYY': ").strip()
- print(' ')
- pet = input(">>> Pet's Name: ").lower().strip()
- co = input(">>> Company Name: ").lower().strip()
- print(' ')
- ask = "[?] Would you like to add additional keywords RE: your target? Y/[N]: "
- w1 = input(ask).lower().strip()
- w2 = ''
- if w1 == 'y':
- ask = (">>> Please enter the words. Separate them with commas."
- "[!] If you leave whitespaces, they are auto-removed.")
- w2 = input(ask).replace(' ', '')
- w = w2.split(',')
- sp = []
- ask = "[+] Would you like to add special characters at the end of the words? Y/[N]: "
- sp1 = input(ask).lower().strip()
- if sp1 == "y":
- for sp1 in CFG['chars']:
- sp.append(sp1)
- for sp2 in CFG['chars']:
- sp.append(sp1 + sp2)
- for sp3 in CFG['chars']:
- sp.append(sp1 + sp2 + sp3)
- num_rand = input("[+] Would you like to add some random numbers at the end of words? Y[N]: ").lower()
- hs_mode = input("[+] Activate Enhanced Mode? Y/[N]: ").lower().strip()
- print(' ')
- print("[+] A customized dictionary password list based on the data you provided is being created...")
- sleep(2)
- print(" Please wait while the system processes your request...")
- print(" Almost done...")
- sleep(2)
- # MOD TARGET BIRTHDATE
- tbyy, tbyyy = tb[-2:], tb[-3:]
- tbyyyy = tb[-4:]
- tb_d, tb_m = tb[1:2], tb[3:4]
- tbdd, tbmm = tb[:2], tb[2:4]
- # MOD PARTNER BIRTHDATE
- pbyy = pb[-2:]
- pbyyy = pb[-3:]
- pbyyyy = pb[-4:]
- pb_d = pb[1:2]
- pb_m = pb[3:4]
- pbdd = pb[:2]
- pbmm = pb[2:4]
- # MOD CHILD'S BIRTHDAY
- kbyy = pb[-2:]
- kbyyy = pb[-3:]
- kbyyyy = pb[-4:]
- kb_d = pb[1:2]
- kb_m = pb[3:4]
- kbdd = pb[:2]
- kbmm = pb[2:4]
- # CAPITALIZE BEGINNING OF STRING
- tnup = tn.title()
- lnup = ln.title()
- nnup = nn.title()
- pup = p.title()
- pnup = pn.title()
- kup = k.title()
- knup = kn.title()
- petup = pet.title()
- coup = co.title()
- wup = [w1.title() for w1 in w]
- word = w + wup
- # REVERSE NAME STRINGS
- rev_tn = tn[::-1]
- rev_tnup = tnup[::-1]
- rev_nn = nn[::-1]
- rev_nnup = nnup[::-1]
- rev_p = p[::-1]
- rev_pup = pup[::-1]
- rev_k = k[::-1]
- rev_kup = kup[::-1]
- # REVERSALS OF REST OF STRINGS
- rev = [rev_tn, rev_tnup, rev_nn, rev_nnup, rev_p, rev_pup, rev_k, rev_kup]
- rev_n = [rev_tn, rev_tnup, rev_nn, rev_nnup]
- rev_w = [rev_p, rev_pup]
- rev_k = [rev_k, rev_kup]
- # COMBINATIONS FOR TARGET'S BIRTHDATE
- tbd = [tbyy, tbyyy, tbyyyy, tb_d, tb_m, tbdd, tbmm]
- bd_list = []
- for bds1 in tbd:
- bd_list.append(bds1)
- for bds2 in tbd:
- if tbd.index(bds1) != tbd.index(bds2):
- bd_list.append(bds1 + bds2)
- for bds3 in tbd:
- condition = (tbd.index(bds1) != tbd.index(bds2) and
- tbd.index(bds2) != tbd.index(bds3) and
- tbd.index(bds1) != tbd.index(bds3))
- if condition:
- bd_list.append(bds1 + bds2 + bds3)
- # COMBINATIONS FOR PARTNER'S BIRTHDATE
- pbd = [pbyy, pbyyy, pbyyyy, pb_d, pb_m, pbdd, pbmm]
- pbd_list = []
- for pbd1 in pbd:
- pbd_list.append(pbd1)
- for pbd2 in pbd:
- if pbd.index(pbd1) != pbd.index(pbd2):
- pbd_list.append(pbd1 + pbd2)
- for pbd3 in pbd:
- condition = (pbd.index(pbd1) != pbd.index(pbd2) and
- pbd.index(pbd2) != pbd.index(pbd3) and
- pbd.index(pbd1) != pbd.index(pbd3))
- if condition:
- pbd_list.append(pbd1 + pbd2 + pbd3)
- # COMBINATIONS FOR CHILD'S BIRTHDATE
- kbd = [kbyy, kbyyy, kbyyyy, kb_d, kb_m, kbdd, kbmm]
- kbd_list = []
- for kbd1 in kbd:
- kbd_list.append(kbd1)
- for kbd2 in kbd:
- if kbd.index(kbd1) != kbd.index(kbd2):
- kbd_list.append(kbd1 + kbd2)
- for kbd3 in kbd:
- condition = (kbd.index(kbd1) != kbd.index(kbd2) and
- kbd.index(kbd2) != kbd.index(kbd3) and
- kbd.index(kbd1) != kbd.index(kbd3))
- if condition:
- kbd_list.append(kbd1 + kbd2 + kbd3)
- # string combinations
- grandmaster = [tn, ln, nn, tnup, lnup, nnup]
- master = [p, pn, pup, pnup, ln, lnup]
- sub_master = [k, kn, kup, knup, ln, lnup]
- change_key = [pet, petup, co, coup]
- # MAIN NAME; STRING MODS
- key_a = []
- for key1 in grandmaster:
- key_a.append(key1)
- for key2 in grandmaster:
- condition = (grandmaster.index(key1) != grandmaster.index(key2) and
- grandmaster.index(key1.title()) != grandmaster.index(key2.title()))
- if condition:
- key_a.append(key1 + key2)
- # WIFE NAME; STRING MODS
- key_aaw = []
- for key1 in master:
- key_aaw.append(key1)
- for key2 in master:
- condition = (master.index(key1) != master.index(key2) and
- master.index(key1.title()) != master.index(key2.title()))
- if condition:
- key_aaw.append(key1 + key2)
- # CHILD NAME; STRING MODS
- key_aak = []
- for key1 in sub_master:
- key_aak.append(key1)
- for key2 in sub_master:
- condition = sub_master.index(key1) != sub_master.index(key2) and \
- sub_master.index(key1.title()) != sub_master.index(key2.title())
- if condition:
- key_aak.append(key1 + key2)
- c1 = list(transmute(grandmaster, bd_list))
- c2 = list(transmute(key_aaw, pbd_list))
- c3 = list(transmute(key_aak, kbd_list))
- c4 = list(transmute(grandmaster, CFG['years']))
- c5 = list(transmute(change_key, CFG['years']))
- c6 = list(transmute(key_aaw, CFG['years']))
- c7 = list(transmute(key_aak, CFG['years']))
- c8 = list(transmute(word, bd_list))
- c9 = list(transmute(word, pbd_list))
- c10 = list(transmute(word, kbd_list))
- c11 = list(transmute(word, CFG['years']))
- c12 = c13 = c14 = c15 = c16 = c21 = []
- if num_rand == "y":
- c12 = list(mod(word, CFG['numfrom'], CFG['numto']))
- c13 = list(mod(grandmaster, CFG['numfrom'], CFG['numto']))
- c14 = list(mod(change_key, CFG['numfrom'], CFG['numto']))
- c15 = list(mod(key_aaw, CFG['numfrom'], CFG['numto']))
- c16 = list(mod(key_aak, CFG['numfrom'], CFG['numto']))
- c21 = list(mod(rev, CFG['numfrom'], CFG['numto']))
- c17 = list(transmute(rev, CFG['years']))
- c18 = list(transmute(rev_w, pbd_list))
- c19 = list(transmute(rev_k, kbd_list))
- c20 = list(transmute(rev_n, bd_list))
- c001 = c002 = c003 = c004 = c005 = c006 = []
- if sp1 == "y":
- c001 = list(transmute(grandmaster, sp))
- c002 = list(transmute(change_key, sp))
- c003 = list(transmute(key_aaw, sp))
- c004 = list(transmute(key_aak, sp))
- c005 = list(transmute(word, sp))
- c006 = list(transmute(rev, sp))
- print("[+] Sorting list and removing duplicates...")
- sets = [set(c1), set(c2), set(c3), set(c4), set(c5),
- set(c6), set(c7), set(c8), set(c9), set(c10),
- set(c11), set(c12), set(c13), set(c14), set(c15),
- set(c16), set(c17), set(c18), set(c19), set(c20),
- set(c21), set(grandmaster), set(change_key), set(master),
- set(sub_master), set(word), set(c001), set(c002), set(c003),
- set(c004), set(c005), set(c006)]
- set1 = set()
- for s in sets:
- set1.update(s)
- list_1 = bd_list + pbd_list + kbd_list + rev + list(set1)
- list_a = sorted(set(list_1))
- list_hs = []
- if hs_mode == "y":
- for x in list_a:
- list_hs.append(run_heatseeker(x))
- list_1 = list_a + list_hs
- list_finished = [x for x in list_1 if CFG['wcfrom'] < len(x) < CFG['wcto']]
- list_finished.sort()
- with open(tn + '.txt', 'w') as f:
- f.write(os.linesep.join(list_finished))
- with open(tn + '.txt') as f:
- lines = len(list(f))
- # shorter, but possibly more memory expensive
- message = ("[+] Saving dictionary to \033[1;31m%s.txt\033[1;m, counting"
- " \033[1;31m%i\033[1;m words.")
- print(message % (tn, lines))
- message = ("[+] Now load your pistolero with \033[1;31m%s.txt\033[1;m and"
- " shoot! Good luck!")
- print(message % tn)
- sys.exit()
- def dl_ftp(ftp_dir, *fns):
- """
- Helper function for download_wordlist(). Download the given files from
- the ftp directory.
- """
- print("\n[+] connecting...\n")
- ftp = ftplib.FTP(FTP_CFG['url'], FTP_CFG['user'], FTP_CFG['password'])
- # ftp.login(FTP_CONFIG['user'], FTP_CONFIG['password'])
- ftp.cwd(FTP_CFG['path'])
- ftp.cwd(ftp_dir)
- dir_prefix = 'dictionaries/%s/' % ftp_dir
- if not os.path.isdir(dir_prefix):
- os.mkdir(dir_prefix)
- def handle_download(target, block):
- # Callback for retrobinary. Prints a progress bar as well
- target.write(block)
- print('.', end=' ')
- for filename in fns:
- with open(dir_prefix + filename, 'wb') as outfile:
- print("\n[+] downloading %s..." % filename)
- callback = functools.partial(handle_download, outfile)
- ftp.retrbinary('RETR %s' % filename, callback)
- print(' done.')
- print('[+] file(s) saved to %s' % dir_prefix)
- ftp.quit()
- def dl_wlist():
- """
- # DOWNLOAD WORDLISTS VIA FTP FROM REPOSITORY; REFER TO CFG FILE FOR MORE DETAILED INFO
- """
- if not os.path.isdir('dictionaries'):
- os.mkdir('dictionaries')
- menu = """
- 1 Moby 14 french 27 places
- 2 afrikaans 15 german 28 polish
- 3 american 16 hindi 39 random
- 4 aussie 17 hungarian 30 religion
- 5 chinese 18 italian 31 russian
- 6 computer 19 japanese 32 science
- 7 croatian 20 latin 33 spanish
- 8 czech 21 literature 34 swahili
- 9 danish 22 movieTV 35 swedish
- 10 databases 23 music 36 turkish
- 11 dictionaries 24 names 37 yiddish
- 12 dutch 25 net 38 exit program
- 13 finnish 26 norwegian
- """
- print("\n Choose the section you want to download:\n")
- print(menu)
- print("\n Files will be downloaded from %s repository" % FTP_CFG['name'])
- print("\n Tip: After downloading wordlist, you can improve it with -w option\n")
- option = input("Enter number: ")
- while not option.isdigit() or int(option) > 38:
- print("\n[x] Your choice is invalid. Please try again. Refer to help command if needed.", file=sys.stderr)
- option = input(">>> Enter number: ")
- option = int(option)
- if option == 38:
- print('[X] Exiting KRAKEN...', file=sys.stderr)
- sleep(1)
- sys.exit()
- # FTP DIRS ARE FIRST TOUPLES
- # DO NOT CHANGE
- arguments = {
- 1: ('Moby', 'mhyph.tar.gz', 'mlang.tar.gz', 'moby.tar.gz',
- 'mpos.tar.gz', 'mpron.tar.gz', 'mthes.tar.gz', 'mwords.tar.gz'),
- 2: ('afrikaans', 'afr_dbf.zip'),
- 3: ('american', 'dic-0294.tar.gz'),
- 4: ('aussie', 'oz.gz'),
- 5: ('chinese', 'chinese.gz'),
- 6: ('computer', 'Domains.gz', 'Dosref.gz', 'Ftpsites.gz', 'Jargon.gz',
- 'common-passwords.txt.gz', 'etc-hosts.gz', 'foldoc.gz',
- 'language-list.gz', 'unix.gz'),
- 7: ('croatian', 'croatian.gz'),
- 8: ('czech', 'czech-wordlist-ascii-cstug-novak.gz'),
- 9: ('danish', 'danish.words.gz', 'dansk.zip'),
- 10: ('databases', 'acronyms.gz', 'att800.gz',
- 'computer-companies.gz', 'world_heritage.gz'),
- 11: ('dictionaries', 'Antworth.gz', 'CRL.words.gz', 'Roget.words.gz',
- 'Unabr.dict.gz', 'Unix.dict.gz', 'englex-dict.gz',
- 'knuth_britsh.gz', 'knuth_words.gz', 'pocket-dic.gz',
- 'shakesp-glossary.gz', 'special.eng.gz', 'words-english.gz'),
- 12: ('dutch', 'words.dutch.gz'),
- 13: ('finnish', 'finnish.gz', 'firstnames.finnish.gz', 'words.finnish.FAQ.gz'),
- 14: ('french', 'dico.gz'),
- 15: ('german', 'deutsch.dic.gz', 'germanl.gz', 'words.german.gz'),
- 16: ('hindi', 'hindu-names.gz'),
- 17: ('hungarian', 'hungarian.gz'),
- 18: ('italian', 'words.italian.gz'),
- 19: ('japanese', 'words.japanese.gz'),
- 20: ('latin', 'wordlist.aug.gz'),
- 21: ('literature', 'LCarrol.gz', 'Paradise.Lost.gz', 'aeneid.gz',
- 'arthur.gz', 'cartoon.gz', 'cartoons-olivier.gz', 'charlemagne.gz',
- 'fable.gz', 'iliad.gz', 'myths-legends.gz', 'odyssey.gz', 'sf.gz',
- 'shakespeare.gz', 'tolkien.words.gz'),
- 22: ('movieTV', 'Movies.gz', 'Python.gz', 'Trek.gz'),
- 23: ('music', 'music-classical.gz', 'music-country.gz', 'music-jazz.gz',
- 'music-other.gz', 'music-rock.gz', 'music-shows.gz',
- 'rock-groups.gz'),
- 24: ('names', 'ASSurnames.gz' 'Congress.gz', 'Family-Names.gz',
- 'Given-Names.gz', 'actor-givenname.gz', 'actor-surname.gz',
- 'cis-givenname.gz', 'cis-surname.gz', 'crl-names.gz', 'famous.gz',
- 'fast-names.gz', 'female-names-kantr.gz', 'female-names.gz',
- 'givennames-ol.gz', 'male-names.gz', 'movie-characters.gz',
- 'names.french.gz', 'names.hp.gz', 'other-names.gz',
- 'shakesp-names.gz', 'surnames-ol.gz', 'surnames.finnish.gz',
- 'usenet-names.gz'),
- 25: ('net', 'hosts-txt.gz', 'inet-machines.gz', 'usenet-loginids.gz',
- 'usenet-machines.gz', 'uunet-sites.gz'),
- 26: ('norwegian', 'words.norwegian.gz'),
- 27: ('places', 'Colleges.gz', 'US-counties.gz', 'World.factbook.gz',
- 'Zipcodes.gz', 'places.gz'),
- 28: ('polish', 'words.polish.gz'),
- 29: ('random', 'Ethnologue.gz', 'abbr.gz', 'chars.gz', 'dogs.gz',
- 'drugs.gz', 'junk.gz', 'numbers.gz', 'phrases.gz', 'sports.gz',
- 'statistics.gz'),
- 30: ('religion', 'Koran.gz', 'kjbible.gz', 'norse.gz'),
- 31: ('russian', 'russian.lst.gz', 'russian_words.koi8.gz'),
- 32: ('science', 'Acr-diagnosis.gz', 'Algae.gz', 'Bacteria.gz',
- 'Fungi.gz', 'Microalgae.gz', 'Viruses.gz', 'asteroids.gz',
- 'biology.gz', 'tech.gz'),
- 33: ('spanish', 'words.spanish.gz'),
- 34: ('swahili', 'swahili.gz'),
- 35: ('swedish', 'words.swedish.gz'),
- 36: ('turkish', 'turkish.dict.gz'),
- 37: ('yiddish', 'yiddish.gz'),
- }
- dl_ftp(*(arguments[option]))
- def dl_adb():
- """
- Download csv from alectodb and save into local file as a list of
- usernames and passwords
- """
- url = CFG['alectourl']
- loc_fn = url.split('/')[-1]
- print("\n[+] Checking if alectodb is not present...")
- if not os.path.isfile('alectodb.csv.gz'):
- print("[+] Downloading alectodb.csv.gz...")
- print(" Please wait while Database is ")
- print(" downloaded and updated to the ")
- print(" most current version. ")
- sleep(2)
- # wf = web file; locf = local file
- wf = urlopen(url)
- locf = open(loc_fn, 'w')
- locf.write(wf.read())
- wf.close()
- locf.close()
- f = gzip.open(loc_fn, 'rb')
- data = csv.reader(f)
- uid_list = []
- pwd_list = []
- for row in data:
- uid_list.append(row[5])
- pwd_list.append(row[6])
- gus = sorted(set(uid_list))
- gpa = sorted(set(pwd_list))
- f.close()
- print("\n[+] Exporting to alectodb-usernames.txt and alectodb-passwords.txt")
- with open('alectodb-usernames.txt', 'w') as uidf:
- uidf.write(os.linesep.join(gus))
- with open('alectodb-passwords.txt', 'w') as pwdf:
- pwdf.write(os.linesep.join(gpa))
- print("[+] Done.")
- def mod(sequence, go, end):
- # THIS FUNCTION WILL MODIFY YOUR STRINGS AND CONCATENATE THEM
- for s in sequence:
- for num in range(go, end):
- yield s + str(num)
- def transmute(sequence, go):
- # SORTS && COMBINES FUNCTIONS VIA transmute FUNCTION
- for kstr in sequence:
- for kstr1 in go:
- yield kstr + kstr1
- def run_heatseeker(s):
- # DRAWS FROM THE HEATSEAKER CONFIG OPTIONS TO CREATE POWER POWERFUL AND DIRECTED PASSWORD CRACKING ATTACK
- for c, n in HS_CFG.items():
- s = s.replace(c, n)
- return s
- def dict_import(fn):
- """Implementation of the -w option. Improve a dictionary by
- interactively questioning the user."""
- with open(fn) as fajl:
- add2dict = fajl.readlines()
- imp_list = len(add2dict)
- dict_exists = []
- for x in add2dict:
- dict_exists.extend(x.split())
- print("\n +~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~+")
- print(" | \033[1;31mWARNING!!!\033[1;m |")
- print(" |[!] Overly-large worldlists are not recommended... |")
- print(" | Make CUSTOM PASSLIST after INTEL for BEST RESULTS. |")
- print(" +~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~+\n")
- ask = "Do you want to concatenate all words from wordlist? Y/[N]: "
- mod0 = input(ask).lower().strip()
- if mod0 == 'y' and imp_list > CFG['threshold']:
- print("\n[-] Maximum number of words for concatenation is %i" % CFG['threshold'])
- print("[-] Check configuration file for increasing this number.\n")
- mod0 = input(ask).lower().strip()
- mod_list = []
- if mod0 == 'y':
- for mod1 in dict_exists:
- for mod2 in dict_exists:
- if dict_exists.index(mod1) != dict_exists.index(mod2):
- mod_list.append(mod1 + mod2)
- sp0 = []
- ask = "Do you want to add special chars at the end of words? Y/[N]: "
- sp1 = input(ask).lower()
- if sp1 == "y":
- for sc0 in CFG['chars']:
- sp0.append(sc0)
- for sc1 in CFG['chars']:
- sp0.append(sc0 + sc1)
- for sc2 in CFG['chars']:
- sp0.append(sc0 + sc1 + sc2)
- ask = "[+] Do you want to add some random numbers at the end of words? Y/[N]: "
- random_num = input(ask).lower().strip()
- hs_mode = input("Activate Heatseeker Mode? Y/[N]: ").lower().strip()
- ca1 = list(transmute(dict_exists, CFG['years']))
- ca2 = []
- if mod0 == "y":
- ca2 = list(transmute(mod_list, CFG['years']))
- ca3 = []
- ca4 = []
- if sp1 == "y":
- ca3 = list(transmute(dict_exists, sp0))
- if mod0 == "y":
- ca4 = list(transmute(mod_list, sp0))
- ca5 = []
- ca6 = []
- if random_num == "y":
- ca5 = list(mod(dict_exists, CFG['numfrom'], CFG['numto']))
- if mod0 == "y":
- ca6 = list(mod(mod_list, CFG['numfrom'], CFG['numto']))
- print("\n[+] Now making a dictionary...")
- print("[+] Sorting list and removing duplicates...")
- sets = [set(ca1), set(ca2), set(ca3),
- set(ca4), set(ca5), set(ca6),
- set(dict_exists), set(mod_list)]
- uq = set()
- for s in sets:
- uq.update(s)
- u0 = sorted(uq)
- hs0 = []
- if hs_mode == "y":
- for x in u0:
- hs0.append(run_heatseeker(x))
- u1 = u0 + hs0
- u2 = [x for x in u1 if CFG['wcfrom'] < len(x) < CFG['wcto']]
- u2.sort()
- with open(fn + '.kraken.txt', 'w') as f:
- f.write(os.linesep.join(u2))
- with open(fn + '.kraken.txt') as f:
- lines = len(list(f))
- msg = ("[+] Saving dictionary to \033[1;31m%s.cupp.txt\033[1;m, counting"
- " \033[1;31m%i words.\033[1;m")
- print(msg % (fn, lines))
- msg = ("[+] Now load your pistolero with \033[1;31m%s.kraken.txt\033[1;m"
- " and shoot! Good luck!")
- print(msg % fn)
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment