0

I am trying to carry out a dictionary attack for a password that is of this structure:

  • 15 characters
  • Lowercase letters and 0-9
  • First a five letter word then 4 numbers, then 6 letter word

Examples of possible passwords:

creek8937basket
arrow3156hardly
eager4109eleven

I can sucessfully use a program like crunch to generate a list of passwords with 5 lowercase letters, 4 numbers and then 6 lowercase letters but I want to somehow use words for the first and last part.

crunch 15 15 -d 2% -d 2@ -t @@@@@%%%%@@@@@@ | aircrack-ng -e ESSID -w - Desktop/wpa2.cap 

How can I create a dictionary so that it uses 5 and 6 letter english words for the first and last part of the password.

I know of two dictionaries for this but I need to find out how to implement them:

NULL
  • 503
  • 1
  • 5
  • 13
  • if my understanding is correct, you won't have room to store all those combos. – dandavis Jan 26 '17 at 17:33
  • @dandavis Yes but I would like to generate them on the fly, like the above crunch command does. As soon as they are made they are piped into aircrack-ng. For the 5 letter words I found a dictionary that has the ~5 thousand english words which is much less than the 11881376 possible lowercase combinations of 5 letters – NULL Jan 26 '17 at 17:51
  • 1
    Isn't this more of a stackoverflow question than a security question? – Goose Jan 26 '17 at 18:04
  • 1
    @Goose I don't think so....at least there are at least 10 other questions on this SE that share the same topic as mine – NULL Jan 26 '17 at 18:10
  • You can do this with JohnTheRipper with a custom configuration – hax Jan 26 '17 at 18:27

1 Answers1

2

This is not exactly what you want but it is a close approximation of it. It will take a random word from 5 letter word list and 6 letter word list and output all possible 4 digit combinations in between the words and print it to a file, ready for further use.

You can repeat this as many times as you like and save all these files as dictionaries or even merge them if you wish to do so. Also this will save your computer from choking itself to death, both space and performance wise.

A python script:

import sys

orig_stdout = sys.stdout
f = file('pass_list', 'w') # Specify the name and path of the output file.
sys.stdout = f

import itertools
from itertools import product
import random

digits = '0123456789' # Set the digits.

prefix = open('5-letter.txt').read().split() # Specifiy the path to 5 letter word list.
first = random.choice(prefix)

suffix = open('6-letter.txt').read().split() # Specifiy the path to 6 letter word list.
last = random.choice(suffix)

for keygen in itertools.product(digits, repeat=4): # Specify the length of the digit combinations.
print (first+ ''.join(keygen)+last)

sys.stdout = orig_stdout
f.close()

Note: Both of the input .txt files need to have one word per line in order to work this properly.

EDIT: I would like to add that you may print out a bigger file if you want but know that chances are, although very slim, that prefix and suffix words will be repeated in the output file. Here is how you can modify the code.

prefix = open('5-letter.txt').read().split() 
a = random.choice(prefix)
b = random.choice(prefix)
c = random.choice(prefix)

suffix = open('6-letter.txt').read().split() 
x = random.choice(suffix)
y = random.choice(suffix)
z = random.choice(suffix)

for keygen in itertools.product(digits, repeat=4): 
print (a+ '' .join(keygen)+x)
for keygen in itertools.product(digits, repeat=4): 
print (b+ '' .join(keygen)+y)
for keygen in itertools.product(digits, repeat=4): 
print (c+ '' .join(keygen)+z)

Not very pretty but it gets the job done. However, as stated above, chances of duplicate increase with repetition. And the bigger the file, the more annoying is to manually edit it.

user633551
  • 353
  • 1
  • 4