#!/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
相关推荐
Shingmc338 分钟前
【Linux】线程互斥与同步Vect__7 小时前
深刻理解进程、线程、程序kyriewen117 小时前
你点的“刷新”是假刷新?前端路由的瞒天过海术末日汐9 小时前
传输层协议UDPTimer@9 小时前
LangChain 教程 04|Agent 详解:让 AI 学会“自己干活“阿珊和她的猫9 小时前
TypeScript中的never类型: 深入理解never类型的使用场景和特点skywalk81639 小时前
Kotti Next的tinyfrontend前端模仿Kotti 首页布局还是不太好看,感觉比Kotti差一点zzzsde11 小时前
【Linux】库的制作和使用(3)ELF&&动态链接CQU_JIAKE11 小时前
4.3【A]