forked from backlion/exp-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweakpwdfuzz.py
47 lines (42 loc) · 953 Bytes
/
weakpwdfuzz.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
import sys
try:
key = sys.argv[1]
dic = open('dic.txt','r')
suc = open('ok.txt','w')
for a in dic:
a = a.strip()
a = a.replace("%username%",key)
print a
suc.write(a+'\n')
dic.close()
suc.close()
except:
print "usage: %s chinabaiker" % sys.argv[0]
练习一下def
import sys
def weakpwdfuzz():
try:
key = sys.argv[1]
dic = open('dic.txt','r')
suc = open('ok.txt','w')
for a in dic:
a = a.strip()
a = a.replace("%username%",key)
print a
suc.write(a+'\n')
dic.close()
suc.close()
except:
print "usage: %s chinabaiker" % sys.argv[0]
if __name__ == '__main__':
weakpwdfuzz()
使用方法
python weakpwdfuzz.py chinabaiker
-------
chinabaiker
chinabaiker1
chinabaiker12
chinabaiker123
chinabaiker123
--------
dic.txt放模版字典,本目录有个规则,可以直接使用