1

I am creating a wordlist with crunch for Bruteforce is easy since you can define what character would be used. But with words for some reason I can't figure out how to set the length of the generated passwords so that the password doesn't have to contain all the words specified.

Example:

the command: 'crunch 1 3 -p this a test' returns:

- atestthis athistest testathis testthisa thisatest thistesta

but i would like for it to return:

- a test this atest athis testa testthis thisa thistest atestthis athistest testathis testthisa thisatest thistesta

this is a python script I wrote to do what I would like crunch to do directly. Is there a way to do this directly with crunch?

import os
import argparse as arg

parser = arg.ArgumentParser()
parser.add_argument('words', help='list of words inside parentheses', type = str)
parser.add_argument('--extra', type = str, help = 'all the extra arguments instide parentheses excluding -p, -t and -o')
args = parser.parse_args()
list_words = args.words.split()
pattern = ''
wordlist_amount = ''

for word in range(1,len(list_words)+1):
    pattern = pattern + 'a'
    command = f'crunch {word} {word} {args.extra} -o temporary_wordlist{word}.txt -t {pattern} -p {args.words}'
    wordlist_amount = wordlist_amount + f'temporary_wordlist{word}.txt '
    os.system(command)
os.system(f'cat {wordlist_amount} > tmp.txt')
os.system('uniq tmp.txt > wordlist.txt')
os.system('rm temporary_wordlist* | rm tmp.txt')
quamrana
  • 37,849
  • 12
  • 53
  • 71
alessio
  • 31
  • 4

0 Answers0