#!/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密码python解决
拿破轮2023-08-19 12:33
相关推荐
万少3 小时前
DeepSeek 昨晚刚开源了 Harness:附万少的2 万字保姆级教程程序员黑豆5 小时前
Java字符串详解无我Code6 小时前
开发者-2026年中总结To_OC6 小时前
LC 560 和为 K 的子数组:前缀和配哈希表,这对组合我是真的服了盐焗鹌鹑蛋7 小时前
【Linux】缓冲区浮生望7 小时前
React 受控与非受控组件:从表单状态管理到实时校验的完整实践明朝百晓生7 小时前
Deep RL learning[2026/8]糖墨夕8 小时前
第二章:AI Agent 到底是个啥?—— 用生活场景把概念讲明白Csvn8 小时前
⚡ content-visibility: auto —— 长页面渲染提速的隐藏神器,白捡的性能优化用户938515635078 小时前
ESLint 代码规范完全指南——从 AST 原理到 flat config 逐行解析