不带字典的Python Winzip密码测试仪

2024-09-29 23:27:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图建立一个没有字典攻击的winzip文件破解程序(为一篇关于密码安全的文章)。它需要在“combos”迭代中滚动,尝试每个组合,直到找到密码。很快就要完成了,但目前它需要将密码输入作为一个字符串,需要转换成字节,而我需要它来尝试combostotal的每个输出

提前谢谢你的帮助

我把它保存在沙盒中https://onlinegdb.com/ryRYih2im

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

Click for screenshot


Tags: 文件字符串https程序com沙盒密码字典
1条回答
网友
1楼 · 发布于 2024-09-29 23:27:23

简单的拉链暴力密码破解器

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

相关问题 更多 >

    热门问题