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

相关推荐
江湖有缘35 分钟前
基于华为openEuler部署WikiDocs文档管理系统
linux·华为
摘星编程36 分钟前
React Native + OpenHarmony:Stepper步进器组件
javascript·react native·react.js
●VON39 分钟前
React Native for OpenHarmony:简易计算器应用的开发与跨平台适配实践
javascript·react native·react.js
Web项目开发2 小时前
Dockerfile创建Almalinux9镜像
linux·运维·服务器
摘星编程8 小时前
OpenHarmony + RN:Placeholder文本占位
javascript·react native·react.js
a1117768 小时前
医院挂号预约系统(开源 Fastapi+vue2)
前端·vue.js·python·html5·fastapi
0思必得08 小时前
[Web自动化] Selenium处理iframe和frame
前端·爬虫·python·selenium·自动化·web自动化
pride.li9 小时前
开发板和Linux--nfs服务挂载
linux·运维·服务器
looking_for__9 小时前
【Linux】应用层协议
linux·服务器·网络
BB_CC_DD9 小时前
Linux截图工具(ubuntu18.04+flameshot(火焰截图))
linux