#!/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 小时前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)掘金安东尼6 小时前
让 JavaScript 更容易「善后」的新能力掘金安东尼6 小时前
用 HTMX 为 React Data Grid 加速实时更新SudosuBash7 小时前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)灵感__idea8 小时前
Hello 算法:众里寻她千“百度”yinuo8 小时前
轻松接入大语言模型API -04袋鼠云数栈UED团队9 小时前
基于 Lexical 实现变量输入编辑器cipher9 小时前
ERC-4626 通胀攻击:DeFi 金库的"捐款陷阱"UrbanJazzerati9 小时前
非常友好的Vue 3 生命周期详解AAA阿giao9 小时前
从零构建一个现代登录页:深入解析 Tailwind CSS + Vite + Lucide React 的完整技术栈