{"id":562,"date":"2024-03-14T17:22:32","date_gmt":"2024-03-14T09:22:32","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=562"},"modified":"2024-03-14T17:22:32","modified_gmt":"2024-03-14T09:22:32","slug":"python%e6%8a%80%e6%9c%af%e6%98%af%e7%9c%9f%e7%89%9b%e4%b8%89%e7%a7%92%e7%a0%b4%e8%a7%a3%e6%96%87%e4%bb%b6%e5%af%86%e7%a0%81%e4%b8%93%e5%ae%b6%e7%9c%8b%e4%ba%86%e9%83%bd%e6%83%ad%e6%84%a7","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/14\/python%e6%8a%80%e6%9c%af%e6%98%af%e7%9c%9f%e7%89%9b%e4%b8%89%e7%a7%92%e7%a0%b4%e8%a7%a3%e6%96%87%e4%bb%b6%e5%af%86%e7%a0%81%e4%b8%93%e5%ae%b6%e7%9c%8b%e4%ba%86%e9%83%bd%e6%83%ad%e6%84%a7\/","title":{"rendered":"Python\u6280\u672f\u662f\u771f\u725b\uff01\u4e09\u79d2\u7834\u89e3\u6587\u4ef6\u5bc6\u7801\uff0c\u4e13\u5bb6\u770b\u4e86\u90fd\u60ed\u6127\uff01"},"content":{"rendered":"<div>\n<p>\u5728\u7ebfwifi\u8dd1\u5305 \u91d1\u521a\u5305\u8dd1\u5305 cap\u8dd1\u5305 hccapx ewsa\u5728\u7ebf \u5c31\u6765 <strong><a href=\"https:\/\/ccwifi.cc\" target=\"_blank\" rel=\"noopener\">\u63e1\u624b\u5305\u8dd1\u5305<\/a><\/strong><\/p>\n<p>\u5404\u4f4d\u597d \u53c8\u89c1\u9762\u4e86 \u6211\u662f\u66f9\u64cd \u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u65b0\u7684\u6559\u7a0b<\/p>\n<p>\u5e0c\u671b\u5404\u4f4d\u7ec6\u5fc3\u5b66\u4e60 \u4f4e\u8c03\u7528\u7f51<\/p>\n<\/div>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710408148122_1.jpg\" alt=\"hashcat\u600e\u4e48\u89e3\u538b\u7f29\u5305\u5bc6\u7801\"><\/p>\n<p>\u5728\u7f51\u7edc\u4e0a\u4e0b\u8f7d\u5e26\u5bc6\u7801\u7684\u538b\u7f29\u5305\u662f\u5e38\u89c1\u7684\u60c5\u51b5\uff0c\u60f3\u8981\u514d\u8d39\u83b7\u53d6\u5185\u5bb9\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u7834\u89e3\u8f6f\u4ef6\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u505a\u6cd5\u5f80\u5f80\u4f1a\u5e26\u6765\u4e0d\u597d\u7684\u540e\u679c\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5229\u7528Python\u7834\u89e3ZIP\/RAR\u538b\u7f29\u5305\u7684\u5bc6\u7801\u3002<\/p>\n<h3 id=\"\">\u7834\u89e3\u539f\u7406<\/h3>\n<p>\u7834\u89e3\u7684\u539f\u7406\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5c1d\u8bd5\u4e0d\u540c\u7684\u5bc6\u7801\u3002Python\u63d0\u4f9b\u4e86\u4e24\u4e2a\u538b\u7f29\u6587\u4ef6\u5e93\uff1azipfile\u548crarfile\uff0c\u901a\u8fc7\u8fd9\u4e24\u4e2a\u5e93\u63d0\u4f9b\u7684extractall()\u65b9\u6cd5\u53ef\u4ee5\u6307\u5b9a\u5bc6\u7801\u8fdb\u884c\u89e3\u538b\u7f29\u3002\u9996\u5148\u9700\u8981\u751f\u6210\u4e00\u4e2a\u5bc6\u7801\u5b57\u5178\uff0c\u7136\u540e\u9010\u4e2a\u5c1d\u8bd5\u5bc6\u7801\uff0c\u5982\u679c\u6210\u529f\u89e3\u538b\u7f29\u5219\u8868\u793a\u5bc6\u7801\u6b63\u786e\u3002<\/p>\n<h3 id=\"-1\">\u5b9e\u9a8c\u73af\u5883<\/h3>\n<p>\u672c\u6587\u4f7f\u7528Pipenv\u4f5c\u4e3a\u865a\u62df\u73af\u5883\uff0c\u901a\u8fc7Pipenv\u5b89\u88c5rarfile\u5e93\u3002\u6700\u540e\uff0c\u5c06\u5e26\u6709\u5bc6\u7801\u7684\u538b\u7f29\u5305\u653e\u5165\u5b9e\u9a8c\u73af\u5883\u4e2d\u3002<\/p>\n<h3 id=\"-2\">\u7f16\u7801<\/h3>\n<p>\u4e86\u89e3\u539f\u7406\u540e\uff0c\u7f16\u5199\u4ee3\u7801\u5c31\u53d8\u5f97\u975e\u5e38\u7b80\u5355\u4e86\u3002<\/p>\n<h3 id=\"-3\">\u51c6\u5907\u5bc6\u7801\u672c<\/h3>\n<p>\u5bc6\u7801\u672c\u5305\u542b\u4e86\u6240\u6709\u53ef\u80fd\u7684\u5bc6\u7801\uff0c\u53ef\u4ee5\u624b\u52a8\u5f55\u5165\u6216\u4f7f\u7528\u7a0b\u5e8f\u5f55\u5165\u3002<\/p>\n<h3 id=\"-4\">\u8bfb\u53d6\u538b\u7f29\u6587\u4ef6<\/h3>\n<pre><code class=\"language-text\">if filename.endswith('.zip'):     \nfp = zipfile.ZipFile(filename) \nelif filename.endswith('.rar'):     \nfp = rarfile.RarFile(filename) <\/code><\/pre>\n<pre><code class=\"language-text\">fp.close() \nprint('No password') \nreturn<\/code><\/pre>\n<pre><code class=\"language-text\"># \u8bfb\u53d6\u5bc6\u7801\u672c\u6587\u4ef6     \nfpPwd = open('pwd.txt') \nexcept:     \nprint('No dict file pwd.txt in current directory.')     \nreturn \nfor pwd in fpPwd:     \npwd = pwd.rstrip()     \ntry:         \nfp.extractall(path=desPath, pwd=pwd.encode())         \nprint('Success! ====&gt;'+pwd)         \nfp.close()         \nbreak     \nexcept:         \npass \nfpPwd.close()<\/code><\/pre>\n<pre><code class=\"language-text\">if __name__ == '__main__':     \nfilename = sys.argv[1]     \nif os.path.isfile(filename) and filename.endswith(('.zip', '.rar')):         decryptRarZipFile(filename)     \nelse:         \nprint('Must be Rar or Zip file')<\/code><\/pre>\n<pre><code class=\"language-text\">$ python main.py test.zip \nSuccess! ====&gt;32312<\/code><\/pre>\n<h3 id=\"\">\u5c1d\u8bd5\u89e3\u538b<\/h3>\n<p>\u9996\u5148\u5c1d\u8bd5\u4e0d\u4f7f\u7528\u5bc6\u7801\u89e3\u538b\u7f29\uff0c\u5982\u679c\u6210\u529f\u5219\u8868\u793a\u538b\u7f29\u6587\u4ef6\u6ca1\u6709\u5bc6\u7801\u3002<\/p>\n<h3 id=\"-1\">\u66b4\u529b\u7834\u89e3<\/h3>\n<p>\u901a\u8fc7\u7a0b\u5e8f\u5165\u53e3\u8fdb\u884c\u66b4\u529b\u7834\u89e3\u3002<\/p>\n<h3 id=\"-2\">\u4f7f\u7528<\/h3>\n<p>\u53ea\u9700\u5728\u547d\u4ee4\u884c\u6267\u884c<code>python main.py<\/code>\u5373\u53ef\u4f7f\u7528\u4ee3\u7801\u3002<\/p>\n<h3 id=\"-3\">\u8fd0\u884c\u7ed3\u679c<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710408148122_3.jpg\" alt=\"hashcat\u600e\u4e48\u89e3\u538b\u7f29\u5305\u5bc6\u7801\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710408148122_4.png\" alt=\"hashcat\u600e\u4e48\u89e3\u538b\u7f29\u5305\u5bc6\u7801\"><\/p>\n<h3 id=\"\">\u6269\u5c55<\/h3>\n<ul>\n<li>\u5982\u4f55\u83b7\u53d6\u5bc6\u7801\u672c\uff1f<\/li>\n<li>\u5982\u4f55\u52a0\u901f\u7834\u89e3\u8fc7\u7a0b\uff1f<\/li>\n<\/ul>\n<h3 id=\"-1\">\u591a\u7ebf\u7a0b\uff08\u8fdb\u7a0b\uff09\u7834\u89e3<\/h3>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/zhuanlan.zhihu.com\/p\/270559938?utm_id=0 --><\/p>\n<h3 id=\"gpu\">\u5229\u7528GPU\u52a0\u901f<\/h3>\n<p>\u901a\u8fc7\u5229\u7528GPU\u8d44\u6e90\u53ef\u4ee5\u52a0\u901f\u5bc6\u7801\u7834\u89e3\u8fc7\u7a0b\u3002CPU\u548cGPU\u5728\u8ba1\u7b97\u4efb\u52a1\u4e0a\u6709\u6240\u4e0d\u540c\uff0cGPU\u7684\u6838\u6570\u8fdc\u8d85CPU\uff0c\u4f46\u6bcf\u4e2a\u6838\u7684\u8fd0\u7b97\u80fd\u529b\u76f8\u5bf9\u8f83\u5f31\u3002\u5728\u5bc6\u7801\u7834\u89e3\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528GPU\u53ef\u4ee5\u663e\u8457\u52a0\u901f\u3002<\/p>\n<p>\u6700\u5feb\u7684\u5bc6\u7801\u6062\u590d\u5de5\u5177\u4e4b\u4e00\u662fHashcat\uff0c\u53ef\u4ee5\u57fa\u4e8eCPU\/GPU\u7b49\u5de5\u4f5c\u3002\u6709\u5174\u8da3\u7684\u53ef\u4ee5\u8bbf\u95ee\u5b98\u7f51\u8fdb\u884c\u4e86\u89e3\u3002<br \/>\n&#8220;`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u6280\u672f\u662f\u771f\u725b\uff01\u4e09\u79d2\u7834\u89e3\u6587\u4ef6\u5bc6\u7801\uff0c\u4e13\u5bb6\u770b\u4e86\u90fd\u60ed\u6127\uff01\u6211\u4eec\u7ecf\u5e38\u4f1a\u4ece\u7f51\u7edc\u4e0a\u4e0b\u8f7d\u4e00\u4e9b\u5e26\u5bc6\u7801\u7684\u538b\u7f29\u5305\uff0c\u60f3\u8981\u83b7\u53d6\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u5f80\u5f80\u5c31\u8981\u7ed9\u63d0\u4f9b\u5546\u652f\u4ed8\u4e00\u4e9b\u8d39\u7528\u3002\u60f3\u8981\u767d\u5ad6\u5176\u4e2d\u7684\u5185\u5bb9\uff0c\u5e38\u89c1\u7684\u505a\u6cd5\u662f\u767e\u5ea6\u641c\u7d22\u4e00\u4e9b\u538b\u7f29\u5305\u5bc6\u7801\u7834\u89e3\u8f6f\u4ef6\uff0c\u4f46\u540e\u679c\u76f8\u4fe1\u4f53\u9a8c\u8fc7\u7684\u4eba\u90fd\u77e5\u9053\u3002<\/p>\n","protected":false},"author":1,"featured_media":563,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/563"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=562"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}