python加密压缩包跑字典

python加密压缩包跑字典

字典

  1. Weakpass: 这是一个专门提供弱口令字典的网站,包括单词、数字、常用密码、常见手机号码等。官网地址:https://weakpass.com/
  2. SecList: 这是一个安全研究者和渗透测试人员常用的资源库,其中收集了一个 “Passwords” 目录,包含着许多大型的字典文件,包括弱口令字典。官网地址:https://github.com/danielmiessler/SecLists/tree/master/Passwords
  3. Probable-Wordlists: 这是一个目前最大的密码字典之一,包含了 2376 个字典文件,包括密码、用户名、社会工程学素材等。官网地址:https://github.com/berzerk0/Probable-Wordlists
  4. CrackStation: 这是一个专门提供密码破解工具的服务网站,其中也提供了许多常见的弱口令字典,包括万能密码、社会工程学密码、差密码等。官网地址:https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionaries.htm
  5. SkullSecurity: 这是一个安全研究者创建的网站,提供了一些常用的弱口令字典,包括 “10k-common-passwords.txt” 等。官网地址:https://wiki.skullsecurity.org/

转自: 常见的弱口令&密码字典下载网站 - 知乎 (zhihu.com)

本次测试使用的字典为:

该密码字典包含1400多万个密码,包含弱密码、常用密码、短密码等组合,适合暴力猜解使用;该文件来源于Kali系统下的密码字典文件;

如果你使用Kali系统,该密码字典位于*/usr/share/wordlists/rockyou.txt.gz*

1400多万个弱口令密码字典下载 - 完美代码 (perfcode.com)

测试代码

# _*_ coding : UTF-8 _*_
# @Time : 2024/2/25 16:58
# @Auther : Tiam
# @File : main.py
# @Project : zipCracker
# @Desc :

import pyzipper
import time


def get_time(f):
    def inner(*arg, **kwarg):
        s_time = time.time()
        res = f(*arg, **kwarg)
        e_time = time.time()
        print('耗时:{}秒'.format(e_time - s_time))
        return res
    return inner


@get_time
def zip_cracker(zip_file, passwd_file):
    # 目标压缩文件
    zip_file = pyzipper.AESZipFile(zip_file, 'r')
    # 密码字典文件
    passwd_file = open(passwd_file, encoding='gbk', errors='ignore')
    lines = passwd_file.readlines()
    total = len(lines)
    start = time.perf_counter()
    # 读取密码文件数据
    for line in lines:
        # 去除换行符
        passwd = line.rstrip('\n')
        # 显示进度百分比
        dur = time.perf_counter() - start
        print('\r当前字典进度:{:.2f}% - {:.2f}s'.format((lines.index(line) + 1) / total * 100, dur), end='')
        # 解压ZIP加密文件
        try:
            zip_file.extractall(pwd=str.encode(passwd))
            print("\n压缩包解密成功,密码为:" + passwd)
            break
        except Exception as e:
            pass
    zip_file.close()
    passwd_file.close()


if __name__ == '__main__':
    zip_cracker('./加密文件/加密的压缩文件(windsor).zip', './字典集/dict.txt')

运行结果

F:\ProgramsDev\Python\Python312\python.exe F:\Tiam\Desktop\JustPlay\Python\zipCracker\main.py 
当前字典进度:0.08% - 34.70s
压缩包解密成功,密码为:windsor
耗时:37.78508758544922秒

进程已结束,退出代码为 0

按照这个速度估算至少需要10~20个小时才能跑完这个字典, 还不一定能得到密码

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

梦中千秋

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值