几行代码,把zip文件直接破解

Posted on 2022-01-17 10:54  mingtianshi  阅读(140)  评论(0编辑  收藏  举报

几行代码,把zip文件直接破解,不想讲解了,如果要使用就直接复制吧,讲解挺累的

import itertools
import zipfile
import os

filename = "zip文件地址"
passwd = "0"
size = 大小
def um(filename,passwd):
    try:
        with zipfile.ZipFile(filename) as zfile:
            zfile.extractall("./" ,pwd=passwd.encode("utf-8"))
        return True
    except:
        return False

chars = "1234567890abcdefghijklmnopqrstuvwsyz"
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

嘿,如果密码太长请忽视这个文章

Copyright © 2024 mingtianshi
Powered by .NET 8.0 on Kubernetes