Skip to content

Instantly share code, notes, and snippets.

@linuxsimba
Last active February 6, 2016 16:45
Show Gist options
  • Select an option

  • Save linuxsimba/8b9ea48b755964823047 to your computer and use it in GitHub Desktop.

Select an option

Save linuxsimba/8b9ea48b755964823047 to your computer and use it in GitHub Desktop.
Generates password dictionary for guessing a password
#!/usr/bin/python
# define the prefix to try since we knew what the password starts with
prefix = ['begin', 'Begin']
# list of sequences to run through
sequences = ['seq1', 'Seq1', 'SEQ1', 'se2', '!', '123', '555', '103', '_']
# open the password file where the dictionary will be saved
newfile = open('mypass.txt', 'w')
# A python3 thing I guess
stuff = list(sequences)
# Generate permutations of the password, starting wth the prefix and then 2 to 6 combos of the "charset"
for i in prefix:
for x in range(2,6):
for p in permutations(stuff, x):
newfile.write(''.join(p) + '\n')
"""
Example output:
==============
beginseq1SEQ1
begin_seq1
Begin_seq1103
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment