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

相关推荐
A_B_C_Q2 小时前
StringBuilder 与 StringBuffer的区别
java·前端
颜酱2 小时前
差分数组:高效处理数组区间批量更新的核心技巧
javascript·后端·算法
洋洋技术笔记3 小时前
vue3+vite+elementplus简单介绍
前端
Joker Zxc3 小时前
【前端基础(Javascript部分)】2、JavaScript的变量和数据类型
开发语言·前端·javascript
yuki_uix3 小时前
别再死记优缺点了:聊聊 REST、GraphQL、WebSocket 的使用场景
前端
We་ct3 小时前
LeetCode 173. 二叉搜索树迭代器:BSTIterator类 实现与解析
前端·算法·leetcode·typescript
weixin_395448913 小时前
main.c_0222cursor
c语言·前端·算法
无尽的沉默4 小时前
Thymeleaf 表达式
java·开发语言·前端
无尽的沉默4 小时前
Spring Boot 整合 Thymeleaf 模板引擎
java·前端·spring boot
We་ct4 小时前
从输入URL到页面显示的完整技术流程
前端·edge·edge浏览器