python编写Zip文件口令暴力破解脚本

废话不多说,直接上代码:

# coding=utf8

import zipfile
from threading import Thread


def extractFile(zFile, password):
    try:
        zFile.extractall(pwd=password)
    except Exception as e:
        pass


def main():
    zFile = zipfile.ZipFile('evil.zip')
    passFile = open('dictionary.txt')
    for line in passFile.readlines():
        password = line.strip('\n')
        t = Thread(target=execfile, args=(zFile, password))
        t.start()


if __name__ == '__main__':
    main()

这里使用多线程来加快破解速度,这个脚本没什么难度,能写出这样的脚本说明你现在已经具备编写自己脚本的初步技能了。继续努力。
接下来的一系列文章给大家编写如何利用python进行渗透。

你可能感兴趣的:(python编写Zip文件口令暴力破解脚本)