#!/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
相关推荐
-Try hard-29 分钟前
Linuv软件编程 | Shell命令码丁_11730 分钟前
为什么前端需要做优化?释怀不想释怀31 分钟前
Linux快捷键,软件安装启动Mr Xu_41 分钟前
告别硬编码:前端项目中配置驱动的实战优化指南Hello World . .1 小时前
Linux:软件编程Byron07071 小时前
从 0 到 1 搭建 Vue 前端工程化体系:提效、提质、降本实战落地哆啦code梦1 小时前
前端存储三剑客:localStorage、sessionStorage与Cookie解析人间打气筒(Ada)1 小时前
k8s:CNI网络插件flannel与calico老师用之于民1 小时前
【DAY21】Linux软件编程基础&Shell 命令、脚本及系统管理实操徐小夕@趣谈前端1 小时前
Web文档的“Office时刻“:jitword共建版2.0发布!让浏览器变成本地生产力