python压缩包解密代码(python破解zip密码)


python压缩包解密代码(python破解zip密码)(1)


今天写了个小脚本,用于暴力破解zip密码

import zipfile from threading import Thread import optparse def testZipPasswd(zfile,passWord): try: zfile.extractall(pwd=passWord) print("[ ] Found Password: " str(passWord,encoding="utf-8")) except Exception as e: #print(e) pass def decodeZipPasswd(zfile,passfile): with open(passfile) as f: zfile = zipfile.ZipFile(zfile) for i in f.readlines(): i = i.replace("\n","") t = Thread(target=testZipPasswd,args=(zfile, i.encode(encoding="utf-8"))) t.start() if __name__ == "__main__": parser = optparse.OptionParser("python zip.py -f <zipfile> -p <passfile>") parser.add_option("-f",dest='zname',type='string',help='specify zip file') parser.add_option("-p",dest='passwd',type='string',help='specify password file') (options,args) = parser.parse_args() if options.zname ==None or options.passwd==None: print(parser.usage) exit(0) else: decodeZipPasswd(options.zname,options.passwd)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页