#!/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
相关推荐
掘金一周11 小时前
你们觉得房贷多少,没有压力 | 沸点周刊 4.30大貔貅喝啤酒11 小时前
接口测试_Postman(详细版)小小码农Come on12 小时前
QML访问子项内容乌托邦的逃亡者12 小时前
CentOS/Openeuler主机中,为一个网卡设置多个IP地址桜吹雪12 小时前
Langchain.js官方文档:构建具备按需加载技能的 SQL 助手han_12 小时前
一篇看懂国内外主流大模型:GPT、Claude、Gemini、DeepSeek、通义千问有什么区别?一行代码一行诗++12 小时前
注释是什么和注释该怎么写(C语言)涂兵兵_青石疏影12 小时前
beginPath-vs-save详解陈振wx:zchen200812 小时前
前端-面试题-JavaScript泽_浪里白条12 小时前
我在 Superset 6.x 做自定义图表 + Embedded SDK 集成的实战复盘(附踩坑清单)