没有字典的Python Winzip密码测试器



我正在尝试构建一个没有字典攻击的winzip文件破解程序(对于一篇关于密码安全性的文章(。它需要滚动浏览"组合"迭代,尝试每个组合,直到找到密码。如此接近完成,但目前它需要将密码条目作为需要转换为字节的单个字符串,而我需要它来尝试组合总数的每个输出

提前感谢您的任何帮助

我已将其保存在沙盒中 https://onlinegdb.com/ryRYih2im

文件链接在这里 https://drive.google.com/open?id=1rpkJnImBJdg_aoiVpX4x5PP0dpEum2fS

点击查看截图

简单的zip暴力破解密码破解程序

from itertools import product
from zipfile import ZipFile, BadZipFile
import string
def find_pw():
pw_length = 1
while True:
s = string.ascii_lowercase
for x in product(s, repeat=pw_length):
pwd = "".join(x)
with ZipFile("test.zip") as zf:
try:
zf.extractall(pwd=bytes(pwd, "UTF-8"))
print("Password is {}".format(pwd))
return
except RuntimeError as e:
pass
except BadZipFile as e:
pass
pw_length += 1
  • 我们需要Itertools.product来完成这种类型的任务。
  • 为简单起见,字符串获得了字母数字字符串

最新更新