【问题标题】:Python Winzip Password Tester without dictionary没有字典的 Python Winzip 密码测试器
【发布时间】:2018-10-23 15:07:21
【问题描述】:

我正在尝试构建一个没有字典攻击的 winzip 文件破解器(关于密码安全的文章)。它需要滚动尝试每个组合的“组合”迭代,直到找到密码。如此接近完成,但目前它需要将密码输入作为单个字符串,需要将其转换为字节,而我需要它来尝试组合的每个输出

提前感谢您的任何帮助

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

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

Click for screenshot

【问题讨论】:

  • 如果你能把你的问题提取到你可以在这里发布的东西中会更好,大多数人不会关注外部链接(除了你可以运行代码的沙箱)
  • 你不能使用 for 循环并尝试每个循环吗?
  • 感谢大家的快速回复。我已将其上传到onlinegdb.com/ryRYih2im 下方链接的沙箱中。我想到只是循环它,但看不到让它工作

标签: python itertools winzip


【解决方案1】:

简单的 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

【讨论】:

    猜你喜欢
    • 2017-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-18
    • 1970-01-01
    • 2021-03-22
    • 1970-01-01
    相关资源
    最近更新 更多