#!/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
相关推荐
镜宇秋霖丶17 小时前
2026.5.6@霖宇博客制作中遇见的问题Yupureki18 小时前
《Linux网络编程》8.网络层IP原理吴声子夜歌18 小时前
Vue3——TypeScript基础Je1lyfish19 小时前
CMU15-445 (2025 Fall/2026 Spring) Project#3 - QueryExecution小李子呢021119 小时前
前端八股Vue---Vue-router路由管理器百锦再20 小时前
Auto.js变成基础知识学习洛_尘20 小时前
Python 5:使用库Bigger20 小时前
Bun 能上生产吗?我的实战结论xyy_49621 小时前
wsl-localhostkyriewen1 天前
你的前端滤镜慢得像PPT?用Rust+WebAssembly,一秒处理4K图