Skip to content

Instantly share code, notes, and snippets.

@icedraco
Created July 28, 2016 00:30
Show Gist options
  • Save icedraco/b8a9209490a9e030d3b9ef19e8c0c259 to your computer and use it in GitHub Desktop.
Save icedraco/b8a9209490a9e030d3b9ef19e8c0c259 to your computer and use it in GitHub Desktop.
Simplistic WPA password dictionary file generator
def str_reverse(s):
t = [z for z in s]
t.reverse()
return "".join(t)
def str_plus_reverse(s):
return s + str_reverse(s)
def expand(master_string):
print "Expanding: " + master_string
mults = []
for l in range(1,7):
mults += [ master_string[i:i+l] for i in range(len(master_string) - l + 1) ]
print " - %d mults..." % len(mults)
mult_combos = []
for i in range(1,11):
mult_combos += [ s*i for s in mults ]
print " - %d mult combos..." % len(mult_combos)
t = [master_string] + mult_combos
print " - t => %d elements" % len(t)
return t + map(str_reverse, t) + map(str_plus_reverse, t)
def main():
master_strings = [
'0123456789',
'1234567890',
'abcdefghijklmnopqrstuvwxyz'
]
output = []
for m in master_strings:
output += expand(m)
output = output + map(str.upper, output)
output = filter(lambda s: s != "" and len(s) >= 6, output)
output.sort()
uniq = []
for o in output:
if o not in uniq:
uniq += [o]
print ">> %d unique filtered elements -> writing..." % len(uniq)
open("generated.txt", 'w').write("\n".join(uniq + ['']))
return 0
if __name__ == "__main__":
raise SystemExit(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment