忘记rar密码python解决

复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os,sys
from unrar import rarfile

def rar_attack(file_name):

    file_handle = rarfile.RarFile('test.rar')
    handle_password = open('passwords.txt')
    for pwd in handle_password:
        pwd = pwd.rstrip()
        try:
            file_handle.extractall(path='test', pwd=pwd.encode())
            print('Found:'+pwd)
            break
        except:
            pass
    handle_password.close()
    file_handle.close()
    
if __name__=='__main__':
    file_name = sys.argv[1]
    if os.path.isfile(file_name) and file_name.endswith('.rar'):
        rar_attack(file_name)
    else:
        print('Not RAR')

三种方法快速破解rar密码 - 知乎

相关推荐
猫头虎3 分钟前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty
开开心心就好4 分钟前
免费轻量电子书阅读器,多系统记笔记听书
linux·运维·服务器·安全·ddos·可信计算技术·1024程序员节
qq_24218863327 分钟前
3389端口内网转发概述
前端·经验分享·html
RisunJan23 分钟前
Linux命令-lvreduce (收缩逻辑卷空间)
linux·运维·服务器
Never_Satisfied31 分钟前
在JavaScript / HTML中,数组查找第一个符合要求元素
开发语言·javascript·html
伊泽瑞尔1 小时前
2025年终总结
前端·程序员·ai编程
uhakadotcom1 小时前
Hono v4.12.0 发布!路由提速2倍+,JSON响应飞起来
前端·面试·github
少云清1 小时前
【UI自动化测试】10_web自动化测试 _frame切换、多窗口切换
前端·web自动化测试
HelloReader1 小时前
做 IM 客户端,选 Tauri 还是 Qt一篇把坑讲清楚的选型与架构指南
前端
HelloReader1 小时前
Tauri 2 创建项目全流程create-tauri-app 一键脚手架 + Tauri CLI 手动接入
前端·javascript·vue.js