#!/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
相关推荐
天下代码客7 小时前
使用electronc框架调用dll动态链接库流程和避坑wangjialelele7 小时前
Linux下的IO操作以及ext系列文件系统weixin199701080168 小时前
【性能提升300%】仿1688首页的Webpack优化全记录HypoxiaDream8 小时前
LINUX-Ext系列⽂件系统小毛驴8508 小时前
Linux curl 命令用法冰暮流星8 小时前
javascript之数组李斯啦果8 小时前
【Linux】Linux目录配置AI+程序员在路上8 小时前
linux下线程中pthread_detach与pthread_join区别代码游侠8 小时前
C语言核心概念复习——C语言基础阶段logocode_li8 小时前
说透 Linux Shell:命令与语法的底层执行逻辑