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

相关推荐
萑澈1 小时前
Windows 7 运行 Electron 安装包报“不是有效的 Win32 应用程序”怎么办
javascript·windows·electron
君穆南1 小时前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
bloglin999991 小时前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索1 小时前
LINUX环境
linux·运维·服务器
yuanjj882 小时前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
W.A委员会2 小时前
JS原型链详解
开发语言·javascript·原型模式
懂懂tty2 小时前
React状态更新流程
前端·react.js
IMPYLH2 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara2 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
LN花开富贵2 小时前
【ROS】鱼香ROS2学习笔记一
linux·笔记·python·学习·嵌入式·ros·agv