python编写简单zip爆破工具

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
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import threading
import time
import zipfile
import sys
def ZipBrute(Zfile,pwd):
try :
Zfile.extractall(pwd = pwd)
#print u" 【经过CPU同志艰苦不屑的努力,终于把你的密码给弄到了!!!】"
print u" 【Password: %s】" %(pwd)
except:
return
def main():
zfile = zipfile.ZipFile(sys.argv[1])
passlist = [x.rstrip() for x in open(sys.argv[2])]
print "+-----------------------------------------------------------------+"
print u" Brute Thread is working!!"
print u" 【密码个数: %s 】"%(len(passlist))
for pwds in passlist:
t = threading.Thread(target=ZipBrute,args=(zfile,pwds))
t.start()
t.join()
print "+-----------------------------------------------------------------+"
def Usage():
Logo = '''
______ _ _____ _____ _____ _ _ _____ _____
|___ / | | | _ | _ | _ | | | | |_ _| | ____|
/ / | | | |_| | | |_| | | |_| | | | | | | | | |__
/ / | | | ___/ | _ { | _ / | | | | | | | __|
/ /__ | | | | | |_| | | | | |_| | | | | |___
/_____| |_| |_| |_____/ |_| _ _____/ |_| |_____|
'''
print "n"
print Logo
print "n"
print " Usage: python zipbrute zip.zip pwd.txt "
print "n"
print " Author:r1b00t "
print "n"
print u" 用多线程爆破zip文件 "
print "n"
if __name__ == '__main__':
if len(sys.argv) != 3:
Usage()
else:
Usage()
main()