#!/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
相关推荐
RH2312111 分钟前
2026.5.12 Linuxcen__y16 分钟前
Linux11(网络编程)ITKEY_25 分钟前
archlinux x11桌面 部分程序识别成WaylandIT_陈寒1 小时前
为什么Java的Stream并行处理反而变慢了?怀旧,1 小时前
【Linux网络编程】9. 数据链路层NiceCloud喜云1 小时前
IntelliJ IDEA 保姆级安装 + ClaudeAPI 配置教程用户2367829801681 小时前
Linux watch 命令深度解析:从实时监控到变化检测的完整实现zithern_juejin1 小时前
Date/RegExp/Error/ArrayBufferzenRRan2 小时前
Karpathy公开附议:AI Agent 的输出格式,正在从 Markdown 走向 HTML燐妤2 小时前
前端HTML编程5:JavaScript完全指南