Это скрипт, который генерирует словарь паролей для угадывания пароля.
Я получаю эту ошибку:
Traceback (most recent call last):
File "pass.py", line 19, in <module>
for p in permutations(stuff, x):
NameError: name 'permutations' is not defined
Код:
#!/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')
Пример вывода:
beginseq1SEQ1
begin_seq1
Begin_seq1103