#!/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
相关推荐
漂流瓶jz4 小时前
BEM、OOCSS、SMACSS、ITCSS、AMCSS、SUITCSS:CSS命名规范简介陈随易8 小时前
真的,你可以不用TypeScript郑州光合科技余经理9 小时前
代码展示:PHP搭建海外版外卖系统源码解析唐璜Taro9 小时前
Vue3 + TypeScript 后台管理系统完整方案dustcell.9 小时前
haproxy七层代理掘金酱9 小时前
「寻找年味」 沸点活动|获奖名单公示🎊哇哈哈202110 小时前
信号量和信号颜酱10 小时前
栈的经典应用:从基础到进阶,解决LeetCode高频栈类问题患得患失94910 小时前
【前端】前端动画优化的核心Xin_z_10 小时前
Vue3 + Sticky 锚点跳转被遮挡问题解决方案