-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpass_generate.py
48 lines (32 loc) · 1.72 KB
/
pass_generate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import itertools
import sys
if len(sys.argv) == 4:
user_list1 = sys.argv[1]
user_list2 = sys.argv[2]
user_list3 = sys.argv[3]
else:
print '\nUsage: %s custom.lst dictionary.lst symbols.lst\n'%sys.argv[0]
sys.exit(1)
comboList = ['']
list1 = open(user_list1,'r').read().split()
list2 = open(user_list2,'r').read().split()
list3 = open(user_list3,'r').read().split()
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2, list3), itertools.product(list3,list2, list1))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2, list3), itertools.product(list3,list1, list2))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2, list3), itertools.product(list2,list3, list1))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2, list3), itertools.product(list1,list2, list3))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2, list3), itertools.product(list1,list3, list2))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2), itertools.product(list1,list2))))
comboList.append(map(''.join, itertools.chain(itertools.product(list1, list2), itertools.product(list1,list1))))
comboList.append(map(''.join, itertools.chain(itertools.product(list2, list3), itertools.product(list2,list3))))
comboList.append(map(''.join, itertools.chain(itertools.product(list3, list2), itertools.product(list3,list2))))
comboList.append(list1)
comboList.append(list2)
created_dictionary = open('generated_dictionary.txt','ab+')
lDictionary = []
for i in comboList:
for word in i:
lDictionary.append(word)
for i in sorted(set(lDictionary)):
created_dictionary.write(i+'\n')
created_dictionary.close()