您的位置:首页 > 其它

zip+密码暴力破解

2017-03-09 10:47 330 查看
import zipfile
import sys
import os
from threading import Thread
def extractall(zfile,password):
try:
zfile.extractall(pwd=password)
print '[+]Find the password '+password
exit(0)
except:
return
def main():
if len(sys.argv)==3:
filename=sys.argv[1]
dictionary=sys.argv[2]
if not os.path.isfile(filename):
print '[-]Zipfile is not exist.'
if not os.path.isfile(dictionary):
print '[-]Dictionary is not exist'
print '[+]Successed args!'
zfile=zipfile.ZipFile(filename)
passwordfile=open(dictionary)
for line in passwordfile.readlines():
password=line.strip('\n')
t=Thread(target=extractall, args=(zfile,password))
t.start()
else:
print '[-]Error args'

if __name__ == '__main__':
main()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: