标签:pwd cti option reading utf-8 main == pytho 用法
#!/usr/bin/env python # -*- coding:UTF-8 -*- #用法 # python CrackZipStrong.py -f ./sqlmap.zip -d dictionary.txt # (‘Found Password:‘, ‘123456‘) import zipfile import threading import optparse def extractFile(zFile,password): try:
#主要函数 zFile.extractall(pwd = password) print("Found Password:",password) except: pass def main(): parser = optparse.OptionParser(‘usage%prog -f <zipfile> -d <dictionary>‘) parser.add_option(‘-f‘,dest=‘zname‘,type=‘string‘,help =‘specify zip file‘) parser.add_option(‘-d‘,dest=‘dname‘,type=‘string‘,help = ‘specify dictionary file‘) option,args = parser.parse_args() if option.zname == None or option.dname == None: print parser.usage exit(0) else: zname = option.zname dname = option.dname zFile = zipfile.ZipFile(zname) dFile = open(dname,‘r‘) for line in dFile.readlines(): password = line.strip(‘\n‘) t = threading.Thread(target = extractFile,args = (zFile,password)) t.start() if __name__ == ‘__main__‘: main()
标签:pwd cti option reading utf-8 main == pytho 用法
原文地址:https://www.cnblogs.com/kunspace/p/10591461.html