-
Notifications
You must be signed in to change notification settings - Fork 9
/
Wi-Fi cracking.py
62 lines (51 loc) · 1.67 KB
/
Wi-Fi cracking.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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#*********************************************************
#* 暴力字典生成器 *
#* 支持自定位数生成,包括大小写字母、特殊符号和数字 *
#* BY:netcat 2012-02-10 *
#* http://www.netcat.tk *
#*********************************************************
import sys,string,itertools
def help():
print '[usage]: python mydic.py -h or --help to get help\n'
print '[usage]: python mydic.py mim max outfile\n'
print ' mim: mim dic length,must be a number\n'
print ' max: max dic length,must be a number\n'
print 'outfile: output filename'
def dic():
chars=string.printable[:-5]
p=[]
for i in xrange(min,max+1):
p.append((itertools.product(chars,repeat=i),))
return itertools.chain(*p)
def write():
f=open(file,'a')
for x in d:
for y in x:
f.write("".join(y))
f.write('\n')
f.close()
print 'Done'
while True:
if len(sys.argv)==4:
try:
min=int(sys.argv[1]);max=int(sys.argv[2])
except:
help()
sys.exit(1)
if min <= max:
d=dic()
file=sys.argv[3]
write()
sys.exit(0)
else:
print 'error:'+sys.argv[2]+'<'+sys.argv[1]
sys.exit(1)
elif len(sys.argv)==2:
if sys.argv[1].lower() == "-h" or sys.argv[1].lower() == "--help":
help()
sys.exit(0)
else:
help()
sys.exit(1)