import itertools
import zipfile
import os
filename = "......." #修改为自己的压缩包的路径
chars = "1234567890abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWXYZ" # 包含大写字母
size = 3 # 密码长度,你需要根据实际情况修改这个值
def um(filename,passwd):
try:
with zipfile.ZipFile(filename) as zfile:
zfile.extractall("./" ,pwd=passwd.encode("utf-8"))
return True
except:
return False
for c in itertools.permutations(chars,size):
passwd = "".join(c)
print(passwd)
result = um(filename,passwd)
if not result:
print("no",passwd)
else:
print("yes",passwd)
break
python代码实现zip加密文件的破解
最新推荐文章于 2024-02-16 11:58:10 发布