{"id":574,"date":"2024-03-14T17:22:58","date_gmt":"2024-03-14T09:22:58","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=574"},"modified":"2024-03-14T17:22:58","modified_gmt":"2024-03-14T09:22:58","slug":"golang%e7%88%86%e7%a0%b4%e7%a0%b4%e8%a7%a3rar5%e5%8e%8b%e7%bc%a9%e6%96%87%e4%bb%b6%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/14\/golang%e7%88%86%e7%a0%b4%e7%a0%b4%e8%a7%a3rar5%e5%8e%8b%e7%bc%a9%e6%96%87%e4%bb%b6%e5%af%86%e7%a0%81\/","title":{"rendered":"golang \u7206\u7834\u7834\u89e3 rar5 \u538b\u7f29\u6587\u4ef6\u5bc6\u7801"},"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\/1710408172326_0.jpg\" alt=\"hashcat\u600e\u4e48\u89e3\u538b\u7f29\u5305\u5bc6\u7801\"><\/p>\n<p>rar5 \u7f51\u4e0a\u5927\u591a\u6570\u7206\u7834\u8f6f\u4ef6\u4e0d\u652f\u6301\uff0c\u53ea\u652f\u6301rar5\u4ee5\u4e0b\u7684\u3002\u6240\u4ee5\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u7206\u7834\u7a0b\u5e8f\uff0c\u8003\u8651\u6027\u80fd\uff0c\u7528Golang\u53bb\u5199\uff0c\u7528\u5230Golang\u91cc\u9762\u7684GO\u7a0b\u3002Go\u6ca1\u6709\u652f\u6301rar5\u89e3\u538b\u7684\u5305\uff0c\u6545\u8c03\u7528cmd\u547d\u4ee4\u53bb\u6267\u884c\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710408172326_3.png\" alt=\"hashcat\u600e\u4e48\u89e3\u538b\u7f29\u5305\u5bc6\u7801\"><\/p>\n<pre class=\"has\"><code>cmd := exec.Command(\"unrar\", \"e\",\"-p\"+pass,rarpath,\"D:\/test\")  \/\/\u89e3\u538b\u51fa\u6765\u4fdd\u5b58 D\/test \u4e0a\nout, _ := cmd.Output()\nfmt.Println(string(out))<\/code><\/pre>\n<pre class=\"has\"><code>    passpath := \"pass.txt\" \n    fp, _ := os.OpenFile(passpath , os.O_RDONLY, 6)\n\tdefer fp.Close()\n\t\/\/ \u521b\u5efa\u6587\u4ef6\u7684\u7f13\u5b58\u533a\n\tr := bufio.NewReader(fp)\n\tfor {\n\t\tpass, err2 := r.ReadBytes('n')\n\t\tif err2 == io.EOF {      \/\/\u6587\u4ef6\u672b\u5c3e\n\t\t\tbreak\n\t\t}\n\t\tpass = pass[:len(pass)-2]   \/\/ \u53bb\u9664\u672b\u5c3e \/n\n\t\tfmt.Println(pass)\n\t}<\/code><\/pre>\n<p>1\u3001\u5148\u4e0b\u8f7dWinRAR\u538b\u7f29\u8f6f\u4ef6\uff0c\u7ed9cmd\u547d\u4ee4\u8c03\u52a8\u3002<br \/>\n2\u3001\u628aWinRAR\u52a0\u5165\u73af\u5883\u53d8\u91cf\uff08\u65b9\u4fbfcmd\u547d\u4ee4\u4f7f\u7528unrar\uff09\u3002<br \/>\n3\u3001\u6d4b\u8bd5\u4e00\u4e0b\u662f\u5426\u53ef\u4ee5\u8c03\u7528\u3002<br \/>\n4\u3001\u52a0\u8f7d\u5bc6\u7801\u96c6\uff0c\u5bc6\u7801\u81ea\u5df1\u751f\u6210\uff0c\u53ef\u4ee5\u53c2\u8003\u6211\u7528Python\u5199\u7684\u5bc6\u7801\u751f\u6210\u5668\u3002<\/p>\n<pre class=\"has\"><code>package main\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os\/exec\"\n\t\"time\"\n)\nvar passpath  string= \"C:\/Go\/src\/GoItem\/pass.txt\"   \/\/\u5bc6\u7801\u96c6 \u8def\u5f84\nvar rarpath string= \"C:\/Go\/src\/GoItem\/aa.rar\"    \t\/\/ rar \u6587\u4ef6\u8def\u5f84\nvar password = make(chan string)   \/\/\u521b\u5efa\u7ba1\u9053\uff0c\u63a5\u6536\u5bc6\u7801\nvar isOver = make(chan bool) \/\/\u5224\u65ad\u662f\u5426\u9000\u51fa\nfunc main() {\n\tgo passtxt(passpath)\nLoop:\n\tfor{\n\t\tselect {\n\t\tcase rarpass:= &lt;-password :\n\t\t\tgo cmdshell(rarpath,rarpass)\n\t\tcase  &lt;-time.After(time.Second * time.Duration(1)) :\n\t\t\tbreak Loop\n\t\tcase &lt;- isOver:\n\t\t\tbreak Loop\n\t\t}\n\t}\n}\nfunc cmdshell(rarpath string,pass string){\n\t\tcmd := exec.Command(\"unrar\", \"e\",\"-p\"+pass,rarpath,\"D:\/test\")  \/\/\u89e3\u538b\u51fa\u6765\u4fdd\u5b58 D\/test \u4e0a\n\t\tout, _ := cmd.Output()\n\t\tfmt.Println(pass)\n\t\tif  len(out) == 248{    \/\/len 248 \u4e3a\u6210\u529f\uff0c\u6bcf\u4e2a\u4eba\u4e0d\u540c\n\t\t\tfmt.Printf(\"\u5bc6\u7801\u4e3a\uff1a%s n\",pass)\n\t\t\tisOver&lt;-true  \/\/ \u6210\u529f\u540e\u9000\u51fa\n\t\t}\n}\nfunc passtxt(passpath string) {\n\tfp, _ := os.OpenFile(passpath , os.O_RDONLY, 6)\n\tdefer fp.Close()\n\t\/\/ \u521b\u5efa\u6587\u4ef6\u7684\u7f13\u5b58\u533a\n\tr := bufio.NewReader(fp)\n\tfor {\n\t\tpass, err2 := r.ReadBytes('n')\n\t\tif err2 == io.EOF {      \/\/\u6587\u4ef6\u672b\u5c3e\n\t\t\tbreak\n\t\t}\n\t\tpass = pass[:len(pass)-2]   \/\/ \u53bb\u9664\u672b\u5c3e \/n\n\t\tpassword &lt;- string(pass)\n\t}\n}<\/code><\/pre>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/blog.csdn.net\/a519395243\/article\/details\/100578937 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>golang \u7206\u7834\u7834\u89e3 rar5 \u538b\u7f29\u6587\u4ef6\u5bc6\u7801rar5 \u7f51\u4e0a\u5927\u591a\u6570\u7206\u7834\u8f6f\u4ef6\u4e0d\u652f\u6301\uff0c\u53ea\u652f\u6301rar5\u4ee5\u4e0b\u7684\u6240\u4ee5\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u7206\u7834\u7a0b\u5e8f\uff0c\u8003\u8651\u6027\u80fd\uff0c\u7528Golang \u53bb\u5199 \uff0c\u7528\u5230Golang \u91cc\u9762\u7684GO\u7a0bGo \u6ca1\u6709\u652f\u6301 rar5 \u89e3\u538b \u7684\u5305<\/p>\n","protected":false},"author":1,"featured_media":575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-574","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\/574","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=574"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/574\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/575"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=574"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}