#!/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
相关推荐
powerfulzyh6 分钟前
Ubuntu24.04远程开机ulimpid6 分钟前
Command | Ubuntu 个别实用命令记录(新建用户、查看网速等)HHoao7 分钟前
Ubuntu启动后第一次需要很久才能启动GTK应用问题小灰兔的小白兔9 分钟前
【Ubuntu】Ubuntu常用命令GFCGUO11 分钟前
ubuntu18.04运行OpenPCDet出现的问题winds~12 分钟前
ubuntu中软件的进程管理-结束软件运行阳光不锈@39 分钟前
麒麟桌面系统安装和配置Node.js叫我龙翔2 小时前
【Linux】进程间关系与守护进程小诸葛的博客2 小时前
Ubuntu如何如何安装tcpdumpS hh2 小时前
【Linux】进程地址空间