#!/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
相关推荐
optimistic_chen1 天前
【Redis系列】主从复制zhyf1191 天前
零刻AI Max395(Ubuntu 24.04)AMD 显卡监控工具(amdgpu_top)部署手册callJJ1 天前
MCP配置与实战:深入理解现代开发工具链Mintopia1 天前
🤖 AI 决策 + 意图OS:未来软件形态的灵魂共舞攀登的牵牛花1 天前
前端向架构突围系列 - 框架设计(四):依赖倒置原则(DIP)Van_Moonlight1 天前
RN for OpenHarmony 实战 TodoList 项目:已完成未完成数量显示程序员爱钓鱼1 天前
Node.js 编程实战:测试与调试 —— 日志与监控方案wdfk_prog1 天前
[Linux]学习笔记系列 -- 内存管理与访问go_bai1 天前
Linux-网络基础