忘记rar密码python解决

复制代码
#!/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密码 - 知乎

相关推荐
song85818 分钟前
韦东山开发手册阅读笔记(五)
linux
LIZhang201622 分钟前
linux写一个脚本实时保存内存占用情况
linux·运维·服务器
小李子呢021123 分钟前
前端八股2---Proxy 代理
前端·javascript·vue.js
IDC02-阿杰34 分钟前
Windows WSL2安装Ubuntu24.04全攻略
linux·windows
bjzhang7544 分钟前
使用 HTML + JavaScript 实现组织架构图
前端·javascript·html·组织架构图
s09071361 小时前
ZYNQ7000 AXI DMA 接收中断(S2MM_introut)全解析:从硬件原理到Linux驱动开发
linux·驱动开发·dma·zynq
军军君011 小时前
Three.js基础功能学习十六:智能黑板实现实例三
前端·javascript·css·vue.js·3d·前端框架·threejs
camellias_1 小时前
ubuntu(二)ubuntu18.04安装mysql8
linux·ubuntu·adb
海上彼尚1 小时前
SVG矢量图形快速入门
前端·html5
藤谷性能1 小时前
Ubuntu 22.04:安装串口调试助手CoolTerm
linux·运维·ubuntu·串口·coolterm