忘记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密码 - 知乎

相关推荐
C_心欲无痕4 小时前
前端实现水印的两种方式:SVG 与 Canvas
前端·安全·水印
zfxwasaboy6 小时前
DRM KMS 子系统(4)Planes/Encoder/Connector
linux·c语言
暮色_年华7 小时前
随想 2:对比 linux内核侵入式链表和 STL 非侵入链表
linux·c++·链表
尾善爱看海7 小时前
不常用的浏览器 API —— Web Speech
前端
dnncool7 小时前
【Linux】操作系统发展
linux
美酒没故事°7 小时前
vue3拖拽+粘贴的综合上传器
前端·javascript·typescript
文言一心7 小时前
LINUX离线升级 Python 至 3.11.9 操作手册
linux·运维·python
XRJ040618xrj8 小时前
如何在Linux中根据物理网卡建立虚拟网卡
linux·服务器·网络
jingling5558 小时前
css进阶 | 实现罐子中的水流搅拌效果
前端·css