Python集成的zipfile模块十分简单易用!如果是对zip文件进行压缩、解压等简单操作,zifile模块能足够使用。在此用Pyhon(2.7.x)演示一个Zip破解机。
import zipfile
import optparse
from threading import Thread
#extractFile() is used for trying to unzip
def extractFile(zFile,password):
try:
zFile.extractall(pwd = password)
#用于匹配字典和压缩密码。
print '[+] Found password ' + password +'.\n'
except:
pass