How to generate dictionary for a dictionary attack?

So you could use python to generate all possible combinations using itertools.permutation

import itertools
res = itertools.permutations('abc',3) # 3 is the length of your result.
for i in res: 
   print ''.join(i)

where 'abc' is a string of possible characters. Note that a and A are not the same!

This will output:

abc
acb
bac
bca
cab
cba

Edit (thanks to @buherator):

If you want repeated letters (e.g. aaa, etc), you need to use itertools.product instead. For instance,

import itertools
res = itertools.product('abc', repeat=3) # 3 is the length of your result.
for i in res: 
    print ''.join(i)

This will output:

aaa
aab
aac
aba
abb
abc
aca
acb
acc
baa
bab
bac
bba
bbb
bbc
bca
bcb
bcc
caa
cab
cac
cba
cbb
cbc
cca
ccb
ccc

Password cracking tools, such as John the Ripper or hashcat, can be used this way. They have various "mangling" rules that will take a dictionary (in your case a one word dictionary) and then apply a number of transformations on it. You can then specify the rules based on the kinds of things you may have done with your password.

Learning how to specify these sorts of rules isn't trivial, and unfortunately you aren't in a position to ask for detailed help without revealing too much about the password.

Here are some sample, annotated, john CONFIGs, which might be of some help:

https://sites.google.com/site/reusablesec/Home/john-the-ripper-files/john-the-ripper-sample-configs-1

And here is a list of john tutorials, but I haven't actually looked at any myself, so again, I can only point you in the general direction:

http://openwall.info/wiki/john/tutorials


You should use crunch or john the ripper. If you know the length and possible combinations of your password you can make a pretty good dictionary. For example you know your password was something like

p@$$w0rd123

or maybe

P@s$word1@3

etc.. you can do

crunch 8 11 pPa@s$wW0oOrd123 -o list.txt

This will make a list with a minimum length of 8 max 11 containing any of the given characters. Note this could be a huge list.