<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rar on 腾图工作室,威远博客,威远工作室,Ease</title>
    <link>/tags/rar/</link>
    <description>Recent content in Rar on 腾图工作室,威远博客,威远工作室,Ease</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Mon, 10 Oct 2022 10:52:21 +0000</lastBuildDate>
    <atom:link href="/tags/rar/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>python爆破rar密码</title>
      <link>/code/2022/101018-crack/</link>
      <pubDate>Mon, 10 Oct 2022 10:52:21 +0000</pubDate>
      <guid>/code/2022/101018-crack/</guid>
      <description>&lt;p&gt;穷举也叫爆破，反正以身试毒，一个一个试，即使有好字典，那也是凭运气。&lt;br&gt;&#xA;需要把解压程序unrar.exe放到当前目录。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/usr/bin/python&#xA;# -*- coding:utf-8 -*-&#xA;&#xA;import time&#xA;import rarfile&#xA;import itertools&#xA;from threading import Thread&#xA;# 用排列组合生成包含大写字母和数字的8位密码列表&#xA;pass_wd_list = (&amp;#34;&amp;#34;.join(x) for x in itertools.product(&amp;#39;abcdefghijklmnopqrstuvwxyz.ZYXWVUTSRQPONMLKJIHGFEDCBA1234567890&amp;#39;, repeat=8))&#xA;&#xA;success = 0    # 记录破解成功标志&#xA;num_flg = 0    # 记录破解次数&#xA;file_name = r&amp;#39;D:\python\my\1.rar&amp;#39;     # 要破解的文件&#xA;file_path = r&amp;#39;D:\python\my\crack_rar&amp;#39;             # 破解后解压位置&#xA;&#xA;def get_now_time():&#xA;    return time.strftime(&amp;#34;%Y-%m-%d %H:%M:%S&amp;#34;, time.localtime())&#xA;&#xA;def decryptRarZipFile():&#xA;    global success, num_flg&#xA;    while success == 0:&#xA;        num_flg += 1&#xA;        pass_wd = next(pass_wd_list)&#xA;&#xA;        fp = rarfile.RarFile(file_name)&#xA;        try:&#xA;            print(&amp;#34;{}{} 当前密码为：{} {}&amp;#34;.format(&amp;#34;\b&amp;#34;*70, get_now_time(), pass_wd, num_flg),end=&amp;#34;&amp;#34;)&#xA;            fp.extractall(path=file_path , pwd=pass_wd.encode())&#xA;            print(&amp;#34;success! password is : {}&amp;#34;.format(pass_wd))&#xA;            fp.close()&#xA;            success = 1    # 破解成功后改变标志值&#xA;        except:&#xA;            pass&#xA;&#xA;&#xA;if __name__ == &amp;#39;__main__&amp;#39;:&#xA;    start_time = time.time()&#xA;    decryptRarZipFile()&#xA;    end_time = time.time()&#xA;    change_time = end_time - start_time&#xA;    print(&amp;#34;破解耗时：{}s&amp;#34;.format(change_time))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
