{"id":4227,"date":"2026-01-04T15:45:14","date_gmt":"2026-01-04T07:45:14","guid":{"rendered":"https:\/\/blog.kangyue.pro\/?p=4227"},"modified":"2026-01-04T16:36:02","modified_gmt":"2026-01-04T08:36:02","slug":"%e5%a4%9a%e7%ba%a7%e8%b7%af%e7%94%b1%e5%99%a8%e9%80%9f%e6%9f%a5wan%e5%8f%a3ip","status":"publish","type":"post","link":"https:\/\/blog.kangyue.pro\/?p=4227","title":{"rendered":"\u591a\u7ea7\u8def\u7531\u5668\u901f\u67e5WAN\u53e3IP"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u67e5\u627e\u672c\u673a\u4f7f\u7528\u7684\u8def\u7531\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528ipconfig\u547d\u4ee4\u3002\u4f46\u67e5\u627e\u4e0a\u7ea7\u8def\u7531\u65f6\uff0c\u53ef\u80fd\u6ca1\u90a3\u4e48\u65b9\u4fbf\u3002\u9042\u5236\u4f5c\u6b64\u5de5\u5177\uff0c\u539f\u7406\u662f\u9010\u4e2a\u8bbf\u95eehttp:\/\/192.168.\u00d7\u00d7\u00d7.1\uff0c\u6700\u540e\u5217\u51fa\u80fd\u8bbf\u95ee\u7684\u3002<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u622a\u56fe<\/h1>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"422\" height=\"332\" src=\"https:\/\/blog.kangyue.pro\/wp-content\/uploads\/2026\/01\/image-1.png\" alt=\"\" class=\"wp-image-4228\"\/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u4ee3\u7801<\/h1>\n\n\n\t\t<div class='wp-block-bch-code-highlight  align' id='bhcCodeHighlight-9801111c-6' data-attributes='{&quot;cId&quot;:&quot;9801111c-6&quot;,&quot;language&quot;:&quot;python&quot;,&quot;code&quot;:&quot;# -*- coding: utf-8 -*-\\nimport socket\\nimport threading\\nfrom concurrent.futures import ThreadPoolExecutor\\nimport tkinter as tk\\nfrom tkinter import ttk\\n\\nTIMEOUT = 1.5\\nMAX_THREADS = 20\\n\\ndef http_check(ip, output):\\n    try:\\n        s = socket.create_connection((ip, 80), timeout=TIMEOUT)\\n        s.sendall(b\\&quot;GET \\\/ HTTP\\\/1.1\\\\r\\\\nHost: test\\\\r\\\\n\\\\r\\\\n\\&quot;)\\n        data = s.recv(100)\\n        s.close()\\n\\n        if b\\&quot;HTTP\\\/\\&quot; in data:\\n            output.insert(tk.END, f\\&quot;[HTTP] http:\\\/\\\/{ip}\\\\n\\&quot;)\\n            output.see(tk.END)\\n    except:\\n        pass\\n\\ndef start_scan(output, btn):\\n    btn.config(state=tk.DISABLED)\\n    output.delete(1.0, tk.END)\\n    output.insert(tk.END, \\&quot;\\u5f00\\u59cb HTTP \\u626b\\u63cf 192.168.xxx.1 \\u2026\\\\n\\\\n\\&quot;)\\n\\n    def task():\\n        with ThreadPoolExecutor(max_workers=MAX_THREADS) as executor:\\n            for i in range(256):\\n                ip = f\\&quot;192.168.{i}.1\\&quot;\\n                executor.submit(http_check, ip, output)\\n\\n        output.insert(tk.END, \\&quot;\\\\n\\u626b\\u63cf\\u5b8c\\u6210\\u3002\\\\n\\&quot;)\\n        btn.config(state=tk.NORMAL)\\n\\n    threading.Thread(target=task, daemon=True).start()\\n\\n# ===== GUI =====\\nroot = tk.Tk()\\nroot.title(\\&quot;\\u771f\\u5b9e\\u8def\\u7531\\u5668\\u626b\\u63cf\\uff08HTTP\\u7248\\uff09\\&quot;)\\nroot.geometry(\\&quot;420x300\\&quot;)\\n\\nframe = ttk.Frame(root, padding=10)\\nframe.pack(fill=tk.BOTH, expand=True)\\n\\nbtn = ttk.Button(frame, text=\\&quot;\\u5f00\\u59cb\\u626b\\u63cf\\&quot;)\\nbtn.pack(fill=tk.X)\\n\\noutput = tk.Text(frame, height=15)\\noutput.pack(fill=tk.BOTH, expand=True, pady=5)\\n\\nbtn.config(command=lambda: start_scan(output, btn))\\n\\nroot.mainloop()\\n&quot;,&quot;align&quot;:&quot;&quot;,&quot;lineNumbers&quot;:true,&quot;theme&quot;:&quot;default&quot;,&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[],&quot;alignment&quot;:&quot;center&quot;,&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;}}'><\/div>\r\n\r\n\t\t\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u622a\u56fe \u4ee3\u7801<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,6],"tags":[],"class_list":["post-4227","post","type-post","status-publish","format-standard","hentry","category-windows","category-6"],"_links":{"self":[{"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/posts\/4227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4227"}],"version-history":[{"count":3,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/posts\/4227\/revisions"}],"predecessor-version":[{"id":4231,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=\/wp\/v2\/posts\/4227\/revisions\/4231"}],"wp:attachment":[{"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kangyue.pro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}