forked from Ewesurper/Mutator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmutator.py
executable file
·197 lines (186 loc) · 4.99 KB
/
mutator.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#Name: Mutator.py
#Purpose:Create mutations of supplied word(s)
#Last updated: 8 July 2019
#Version: 2.0
#Created by: Ewesurper
##Example Commands:
#python mutator.py -w password
#python mutator.py -w password >> password_mutations.txt
#python mutator.py -d2 -w password
#python muation.py -d2 -w password >> password_mutations_full.txt
#Import Libraries
import argparse
import itertools
#Define Argparse
parser = argparse.ArgumentParser()
parser.add_argument('-w', action='store', dest='user_word', help='Word to mutate')
#parser.add_argument('-l', action='store', dest='user_list', help='Wordlist to mutate')
#parser.add_argument('-o', action='store', dest='file_output', help='File to output results')
parser.add_argument('-d2', action='store_true', dest='d2', help='Chose to use the second, more complete, dictionary')
args = parser.parse_args()
#Define Dictionaries
#Words will be mutated based off the dictionary picked
#Dictionary with common replacements
d1 = {
'a':['a','A','@','4'],
'b':['b','B','8'],
'c':['c','C','<','k','K'],
'd':['d','D'],
'e':['e','E','3'],
'f':['f','F','ph'],
'g':['g','G','6','9'],
'h':['h','H'],
'i':['i','I','1','|','!'],
'j':['j','J'],
'k':['k','K','c','C'],
'l':['l','L','|'],
'm':['m','M'],
'n':['n','N'],
'o':['o','O','0'],
'p':['p','P'],
'q':['q','Q'],
'r':['r','R'],
's':['s','S','z','Z','$','5'],
't':['t','T','7'],
'u':['u','U'],
'v':['v','V'],
'w':['w','W'],
'x':['x','X'],
'y':['y','Y'],
'z':['z','Z','s','S','2'],
'0':['0'],
'1':['1'],
'2':['2'],
'3':['3'],
'4':['4'],
'5':['5'],
'6':['6'],
'7':['7'],
'8':['8'],
'9':['9'],
'0':['0'],
'!':['!'],
'@':['@'],
'#':['#'],
'$':['$'],
'%':['%'],
'^':['^'],
'&':['&'],
'*':['*'],
'(':['('],
')':[')'],
'-':['-'],
'_':['_'],
'+':['+'],
'=':['='],
'{':['{'],
'}':['}'],
'[':['['],
']':[']'],
'|':['|'],
'\\':['\\'],
'`':['`'],
'~':['~'],
':':[':'],
';':[';'],
'"':['"'],
'\'':['\''],
'<':['<'],
'>':['>'],
'?':['?'],
',':[','],
'.':['.'],
'/':['/'],
' ':[' ']
}
#Dictionary with rare and complex replacements
#Pulled off the wiki page. Deleted some that didnt make any sense
#https://simple.wikipedia.org/wiki/Leet
#Some still seem very obscure to me. Maybe I am just not cool enough to understand them. I included them anyway
d2 = {
'a':['a','A','4','@','/-\\','/_\\','/\\','Д'],
'b':['b','B','8','|3','13','|8','18','6','|B','|8','lo','|o','j3','ß'],
'c':['c','C','k','K','<','{','[','(','©','¢'],
'd':['d','D','|)','|}','|]'],
'e':['e','E','3','£','₤','€'],
'f':['f','F','|=','ph','|#'],
'g':['g','G','6','9'],
'h':['h','H','4','|-|','[-]','{-}','}-{','}{','|=|','[=]','{=}','/-/','(-)',')-(',':-:','I+I'],
'i':['i','I','1','|','!','eye'],
'j':['j','J','_|','_/','_7','_)','_]','_}'],
'k':['k','K','c','C','|<','1<','l<','|{','l{'],
'l':['l','L','1','!','|','|_'],
'm':['m','M','44','|\\/|','^^','/\\/\\','/X\\','[\\/]','[V]','(V)','N\\'],
'n':['n','N','|\|','/\/','/V','И'],
'o':['o','O','0','()','[]','{}','<>','Ø','oh'],
'p':['p','P','|o','|O','|>','|*','|°','|D','/o','[]D','|7'],
'q':['q','Q','O_','9','(,)','0''kw'],
'r':['r','R','|2','12','.-','|^','l2','Я','®'],
's':['s','S','z','Z','5','$','§'],
't':['t','T','7','+','7`','\'|\'','`|`','~|~','-|-','\'][\''],
'u':['u','U','|_|','\\_\\','/_/','\\_/','(_)','[_]','{_}'],
'v':['v','V','\\/'],
'w':['w','W','uu','UU','\\/\\/','(/\\)','\\^/','|/\\|','\\X/','\\\\','//','vv','VV','\\_|_/','\\\\//\\\\//','Ш','2u','\\V/'],
'x':['x','X','%','*','><','}{',')(','Ж'],
'y':['y','Y','`/','¥','\\|/','Ч'],
'z':['z','Z','s','S','2','5','7_','>_','(/)'],
'0':['0'],
'1':['1'],
'2':['2'],
'3':['3'],
'4':['4'],
'5':['5'],
'6':['6'],
'7':['7'],
'8':['8'],
'9':['9'],
'0':['0'],
'!':['!'],
'@':['@'],
'#':['#'],
'$':['$'],
'%':['%'],
'^':['^'],
'&':['&'],
'*':['*'],
'(':['('],
')':[')'],
'-':['-'],
'_':['_'],
'+':['+'],
'=':['='],
'{':['{'],
'}':['}'],
'[':['['],
']':[']'],
'|':['|'],
'\\':['\\'],
'`':['`'],
'~':['~'],
':':[':'],
';':[';'],
'"':['"'],
'\'':['\''],
'<':['<'],
'>':['>'],
'?':['?'],
'?':['?'],
',':[','],
'.':['.'],
'/':['/'],
' ':[' ']
}
#Create character list from user supplied word
characterlist = list(args.user_word.lower())
#Create list of possibilities
list_o_possibilities = []
#Assemble the list of lists
if args.d2 == True:
for character in characterlist:
list_o_possibilities.append(d2[character])
else:
for character in characterlist:
list_o_possibilities.append(d1[character])
#Print mutations
for element in itertools.product(*list_o_possibilities):
print(''.join(element))