【pyhton】暴力硬解zip,只要算力够,字典够大,速度就很快
【代码】【pyhton】暴力硬解zip,只要算力够,字典够大,速度就很快。
·
pyhton暴力硬解zip,只要算力够,字典够大,速度就很快
import zipfile
import os
import traceback
import shutil
def read_dicts(filename):
dicts=[]
with open(filename,'r') as fp:
dicts=[pwd.strip() for pwd in fp.readlines()]
return dicts
def blast(zip_f,pwd):
try:
zip_f.extractall('./temp',pwd=pwd.encode())
return pwd
except Exception as e:
if 'Bad password'in str(e):
return False
traceback.print_exc()
if __name__ == '__main__':
dict_file = './zipzdian.txt'
zip_file = zipfile.ZipFile('./6611.zip')
for password in read_dicts(dict_file):
result=blast(zip_file,password)
if result:
print("密码为:%s" %(result))
break
else:
print('[-] not found password.')
shutil.rmtree('./temp')
os.mkdir('./temp')
更多推荐
所有评论(0)