忘记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密码 - 知乎

相关推荐
mCell4 小时前
GSAP ScrollTrigger 详解
前端·javascript·动效
gnip4 小时前
Node.js 子进程:child_process
前端·javascript
excel7 小时前
为什么在 Three.js 中平面能产生“起伏效果”?
前端
excel8 小时前
Node.js 断言与测试框架示例对比
前端
天蓝色的鱼鱼10 小时前
前端开发者的组件设计之痛:为什么我的组件总是难以维护?
前端·react.js
codingandsleeping10 小时前
使用orval自动拉取swagger文档并生成ts接口
前端·javascript
石金龙11 小时前
[译] Composition in CSS
前端·css
白水清风11 小时前
微前端学习记录(qiankun、wujie、micro-app)
前端·javascript·前端工程化
Ticnix11 小时前
函数封装实现Echarts多表渲染/叠加渲染
前端·echarts
用户221520442780011 小时前
new、原型和原型链浅析
前端·javascript