{"id":90254,"date":"2026-08-04T23:16:43","date_gmt":"2026-08-04T15:16:43","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/90254.html"},"modified":"2026-08-04T23:16:43","modified_gmt":"2026-08-04T15:16:43","slug":"%e4%bb%8e-netstat-ano-%e5%88%b0%e8%87%aa%e7%a0%94%e5%ae%89%e5%85%a8%e5%b7%a5%e5%85%b7%ef%bc%9aportsentinel-%e5%ae%9e%e6%88%98%e5%bc%80%e5%8f%91%e6%89%8b%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/90254.html","title":{"rendered":"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0"},"content":{"rendered":"<h2><\/h2>\n<p>\u522b\u518d\u4e0b\u90a3\u4e9b\u6765\u8def\u4e0d\u660e\u7684\u7eff\u8272\u7248\u4e86&#xff0c;\u6211\u7528 Python \u624b\u6413\u4e86\u4e00\u4e2a\u7aef\u53e3\u626b\u63cf\u4e0e\u5b89\u5168\u76d1\u63a7\u5de5\u5177\u3002<\/p>\n<hr \/>\n<h3>0x00 \u5f15\u5b50&#xff1a;\u65b0\u673a\u521d\u542f&#xff0c;\u767e\u201c\u5b54\u201d\u96be\u5b89<\/h3>\n<p>\u6545\u4e8b\u53d1\u751f\u5728 2026 \u5e74 8 \u6708 4 \u65e5\u7684\u6e05\u6668\u3002<\/p>\n<p>\u65b0\u914d\u7684\u53f0\u5f0f\u673a\u5230\u4e86&#xff0c;Windows 10 \u7cfb\u7edf\u6e05\u723d\u5f97\u50cf\u4e00\u5f20\u767d\u7eb8\u3002\u4f5c\u4e3a\u4e00\u4e2a\u624b\u75d2\u96be\u8010\u7684\u5b89\u5168\u7231\u597d\u8005&#xff0c;\u6211\u4e60\u60ef\u6027\u5730\u6572\u4e0b\u4e86\u90a3\u6761\u523b\u5728 Windows \u7ba1\u7406\u5458 DNA \u91cc\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p> netstat -ano<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1004\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151640-6a720258e3bea.png\" width=\"797\" \/><\/p>\n<p>\u5c4f\u5e55\u77ac\u95f4\u6eda\u51fa\u5bc6\u5bc6\u9ebb\u9ebb\u7684\u5217\u8868\u3002\u4e00\u4e2a\u521a\u88c5\u597d\u3001\u8fde\u989d\u5916\u8f6f\u4ef6\u90fd\u6ca1\u88c5\u7684\u7cfb\u7edf&#xff0c;\u5c45\u7136\u6302\u7740\u4e8c\u5341\u591a\u4e2a\u76d1\u542c\u7aef\u53e3&#xff1a;<\/p>\n<p>TCP \u00a0  0.0.0.0:135 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0.0.0.0:0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  LISTENING \u00a0 \u00a0 \u00a0 1348<br \/>\nTCP \u00a0  0.0.0.0:445 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0.0.0.0:0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  LISTENING \u00a0 \u00a0 \u00a0 4<br \/>\nTCP \u00a0  0.0.0.0:3389 \u00a0 \u00a0 \u00a0 \u00a0  0.0.0.0:0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  LISTENING \u00a0 \u00a0 \u00a0 1504 <\/p>\n<p>\u2026\u2026\u2026\u2026<\/p>\n<p>\u2026\u2026\u2026\u2026<\/p>\n<p>\u2026\u2026\u2026\u2026<\/p>\n<p>135&#xff08;RPC&#xff09;\u2014\u2014\u51b2\u51fb\u6ce2\u8815\u866b\u7684\u8001\u5de2&#xff1b;445&#xff08;SMB&#xff09;\u2014\u2014WannaCry \u52d2\u7d22\u75c5\u6bd2\u5c31\u662f\u4ece\u8fd9\u6740\u8fdb\u6765\u7684&#xff1b;3389&#xff08;RDP&#xff09;\u2014\u2014BlueKeep \u6f0f\u6d1e\u80fd\u8ba9\u653b\u51fb\u8005\u4e0d\u8ba4\u8bc1\u5c31\u6267\u884c\u4efb\u610f\u4ee3\u7801\u3002\u65b0\u673a\u5668\u50cf\u6ca1\u9501\u95e8\u7684\u4ed3\u5e93&#xff0c;\u95e8\u5916\u5c31\u662f\u6574\u4e2a\u4e92\u8054\u7f51\u3002<\/p>\n<p>\u600e\u4e48\u529e&#xff1f;<\/p>\n<ul>\n<li>\n<p>\u7528 Nmap&#xff1f;\u53c2\u6570\u6bd4\u6211\u5934\u53d1\u8fd8\u591a&#xff0c;\u67e5\u624b\u518c\u7ffb\u5230\u624b\u62bd\u7b4b\u3002<\/p>\n<\/li>\n<li>\n<p>\u7528 TCPView&#xff1f;Sysinternals \u51fa\u54c1\u867d\u597d&#xff0c;\u4f46\u95ed\u6e90\u3001\u65e0\u98ce\u9669\u8bc4\u7ea7\u3001\u65e0\u6f0f\u6d1e\u5e93\u3002<\/p>\n<\/li>\n<li>\n<p>\u7528 CurrPorts&#xff1f;\u7f3a\u65e5\u5fd7\u3001\u7f3a\u77e5\u8bc6\u5e93\u3001\u7f3a\u672c\u5730\u5316\u4e2d\u6587\u3002<\/p>\n<\/li>\n<li>\n<p>\u53bb\u7f51\u4e0a\u4e0b\u4e2a\u7eff\u8272\u7248&#xff1f;\u8c01\u77e5\u9053\u662f\u54ea\u5e74\u7684\u7248\u672c&#xff1f;\u6709\u6ca1\u6709\u88ab\u690d\u5165\u540e\u95e8&#xff1f;<\/p>\n<\/li>\n<\/ul>\n<p>\u4e00\u4e2a\u5ff5\u5934\u5192\u4e86\u51fa\u6765&#xff1a;\u4e0e\u5176\u7528\u522b\u4eba\u7684\u5200&#xff0c;\u4e0d\u5982\u81ea\u5df1\u94f8\u4e00\u628a\u3002<\/p>\n<p>\u4e0d\u5c31\u662f\u7aef\u53e3\u626b\u63cf\u52a0\u8fde\u63a5\u76d1\u63a7\u561b\u2014\u2014Windows \u5e95\u5c42 API \u6446\u5728\u90a3\u91cc&#xff0c;Python \u7684 ctypes \u80fd\u8c03&#xff0c;PyQt5 \u80fd\u505a\u754c\u9762&#xff0c;\u6211\u51b3\u5b9a\u81ea\u5df1\u5199\u4e00\u4e2a\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u7684\u540d\u5b57\u5c31\u662f PortSentinel &#xff0c;\u76ee\u524dv0.08\u7248\u672c\u5df2\u5f00\u6e90\u5728 GitHub&#xff08;github.com\/donoot\/PortSentinel&#xff09;\u3002<\/p>\n<hr \/>\n<h3>0x01 \u9876\u5c42\u8bbe\u8ba1&#xff1a;\u4e09\u5c42\u67b6\u6784\u4e0e\u6838\u5fc3\u6a21\u5757<\/h3>\n<p>\u52a8\u5de5\u4e4b\u524d\u5148\u753b\u84dd\u56fe\u3002\u6211\u9700\u8981\u4e00\u4e2a\u6e05\u6670\u7684\u5206\u5c42\u7ed3\u6784&#xff0c;\u8ba9\u4ee3\u7801\u53ef\u7ef4\u62a4\u3001\u53ef\u6d4b\u8bd5\u3001\u53ef\u66ff\u6362\u3002<\/p>\n<h4>\u67b6\u6784\u603b\u89c8<\/h4>\n<p>\u6211\u91c7\u7528\u4e86\u7ecf\u5178\u7684\u4e09\u5c42\u67b6\u6784&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"510\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151641-6a72025954779.png\" width=\"914\" \/><\/p>\n<table>\n<tr>\u5c42\u7ea7\u6a21\u5757\u6280\u672f\u9009\u578b<\/tr>\n<tbody>\n<tr>\n<td>GUI \u5c42<\/td>\n<td>\u4e3b\u7a97\u53e3\u3001\u5de5\u4f5c\u7ebf\u7a0b\u3001\u53f3\u952e\u83dc\u5355<\/td>\n<td>PyQt5&#xff08;\u4fe1\u53f7\u69fd\u9a71\u52a8&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6838\u5fc3\u4e1a\u52a1\u5c42<\/td>\n<td>\u7aef\u53e3\u626b\u63cf\u5668\u3001\u8fde\u63a5\u7ba1\u7406\u5668\u3001OS \u6307\u7eb9\u3001\u6f0f\u6d1e\u5e93\u3001\u65e5\u5fd7\u7cfb\u7edf<\/td>\n<td>Python \u7eaf\u903b\u8f91\u5c01\u88c5<\/td>\n<\/tr>\n<tr>\n<td>\u7cfb\u7edf\u63a5\u53e3\u5c42<\/td>\n<td>Windows API \u8c03\u7528\u3001Socket\u3001\u8fdb\u7a0b\u7ba1\u7406<\/td>\n<td>ctypes &#043; iphlpapi.dll &#043; psutil<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f9d\u8d56\u65b9\u5411\u81ea\u4e0a\u800c\u4e0b&#xff1a;GUI \u5c42\u4f9d\u8d56\u4e1a\u52a1\u5c42&#xff0c;\u4e1a\u52a1\u5c42\u4f9d\u8d56\u7cfb\u7edf\u63a5\u53e3\u5c42\u3002\u5373\u4f7f\u5c06\u6765\u628a PyQt5 \u6362\u6210 PySide6&#xff0c;\u6838\u5fc3\u4e1a\u52a1\u5c42\u53ef\u4ee5\u7eb9\u4e1d\u4e0d\u52a8\u3002<\/p>\n<h4>\u6a21\u5757\u6e05\u5355<\/h4>\n<ul>\n<li>\n<p>PortScanner&#xff1a;\u591a\u7ebf\u7a0b TCP Connect \u626b\u63cf\u5668&#xff0c;\u652f\u6301\u534f\u4f5c\u5f0f\u53d6\u6d88<\/p>\n<\/li>\n<li>\n<p>ConnectionManager&#xff1a;\u901a\u8fc7 iphlpapi.dll \u679a\u4e3e\/\u5173\u95ed TCP\/UDP \u8fde\u63a5<\/p>\n<\/li>\n<li>\n<p>PortDatabase&#xff1a;107&#043; \u7aef\u53e3\u7684 JSON \u77e5\u8bc6\u5e93&#xff0c;\u56db\u7ea7\u98ce\u9669\u5206\u7c7b<\/p>\n<\/li>\n<li>\n<p>OSFingerprint&#xff1a;\u57fa\u4e8e\u5f00\u653e\u7aef\u53e3\u7ec4\u5408\u7684\u52a0\u6743\u8bc4\u5206 OS \u63a8\u65ad<\/p>\n<\/li>\n<li>\n<p>VulnerabilityDatabase&#xff1a;20&#043; CVE \u6f0f\u6d1e\u5e93&#xff08;\u6c38\u6052\u4e4b\u84dd\u3001BlueKeep\u3001SMBGhost \u7b49&#xff09;<\/p>\n<\/li>\n<li>\n<p>AppLogger&#xff1a;\u7ed3\u6784\u5316\u65e5\u5fd7&#xff0c;\u683c\u5f0f netinfo_YYYYMMDD_HHMMSS_\u4e3b\u673a\u540d.log<\/p>\n<\/li>\n<li>\n<p>MainWindow&#xff1a;\u53cc\u6807\u7b7e\u9875 GUI&#xff08;\u626b\u63cf\u7ed3\u679c &#043; \u6d3b\u52a8\u8fde\u63a5&#xff09;&#xff0c;19 \u9879\u53f3\u952e\u529f\u80fd<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>0x02 \u653b\u575a\u96be\u70b9\u4e00&#xff1a;\u7528 ctypes \u9a6f\u670d Windows IP Helper API<\/h3>\n<p>\u4e3a\u4ec0\u4e48\u4e0d\u7528 subprocess \u8c03 netstat&#xff1f;\u56e0\u4e3a\u89e3\u6790\u6587\u672c\u8106\u5f31\u5f97\u8ddf\u73bb\u7483\u4e00\u6837\u2014\u2014\u6362\u4e2a Windows \u7248\u672c&#xff0c;\u8f93\u51fa\u683c\u5f0f\u4e00\u53d8&#xff0c;\u7a0b\u5e8f\u5c31\u5d29\u4e86\u3002<\/p>\n<p>\u5e95\u5c42\u786c\u6865\u786c\u9a6c&#xff0c;\u624d\u591f\u7a33\u5065\u3002<\/p>\n<h4>IP Helper API \u4e09\u4ef6\u5957<\/h4>\n<p>Windows \u7684 iphlpapi.dll \u63d0\u4f9b\u4e86\u4e09\u4e2a\u5173\u952e\u51fd\u6570&#xff1a;<\/p>\n<li>\n<p>GetExtendedTcpTable&#xff1a;\u83b7\u53d6 TCP \u8fde\u63a5\u8868&#xff08;\u542b\u8fdb\u7a0b PID&#xff09;<\/p>\n<\/li>\n<li>\n<p>GetExtendedUdpTable&#xff1a;\u83b7\u53d6 UDP \u8fde\u63a5\u8868<\/p>\n<\/li>\n<li>\n<p>SetTcpEntry&#xff1a;\u5f3a\u5236\u5173\u95ed TCP \u8fde\u63a5&#xff08;\u9700\u7ba1\u7406\u5458\u6743\u9650&#xff09;<\/p>\n<\/li>\n<h4>\u4e24\u6b21\u8c03\u7528\u6cd5&#xff08;\u907f\u5751\u6307\u5357&#xff09;<\/h4>\n<p>\u53d8\u957f\u7ed3\u6784\u4f53\u662f\u7b2c\u4e00\u4e2a\u5927\u5751\u3002\u8fde\u63a5\u6570\u91cf\u52a8\u6001\u53d8\u5316&#xff0c;\u4e0d\u77e5\u9053\u7f13\u51b2\u533a\u8be5\u5f00\u591a\u5927\u3002\u89e3\u51b3\u65b9\u6cd5\u662f\u4e24\u6b21\u8c03\u7528&#xff1a;<\/p>\n<p>iphlpapi &#061; ctypes.WinDLL(&#039;iphlpapi.dll&#039;)<br \/>\nAF_INET &#061; 2<br \/>\nTCP_TABLE_OWNER_PID_ALL &#061; 5<br \/>\n\u200b<br \/>\n# \u7b2c\u4e00\u6b21\u8c03\u7528&#xff1a;\u4f20\u7a7a\u6307\u9488&#xff0c;\u83b7\u53d6\u6240\u9700\u7f13\u51b2\u533a\u5927\u5c0f<br \/>\nsize &#061; ctypes.wintypes.DWORD(0)<br \/>\niphlpapi.GetExtendedTcpTable(<br \/>\n \u00a0 \u00a0None, ctypes.byref(size), False,<br \/>\n \u00a0 \u00a0AF_INET, TCP_TABLE_OWNER_PID_ALL, 0<br \/>\n)<br \/>\n\u200b<br \/>\n# \u7b2c\u4e8c\u6b21\u8c03\u7528&#xff1a;\u6309\u5927\u5c0f\u5206\u914d\u7f13\u51b2\u533a&#xff0c;\u771f\u6b63\u53d6\u6570\u636e<br \/>\nbuf &#061; (ctypes.c_byte * size.value)()<br \/>\niphlpapi.GetExtendedTcpTable(<br \/>\n \u00a0 \u00a0buf, ctypes.byref(size), False,<br \/>\n \u00a0 \u00a0AF_INET, TCP_TABLE_OWNER_PID_ALL, 0<br \/>\n) <\/p>\n<h4>\u6307\u9488\u7b97\u672f\u7834\u89e3\u96f6\u957f\u5ea6\u6570\u7ec4<\/h4>\n<p>C \u7ed3\u6784\u4f53\u91cc\u7684\u67d4\u6027\u6570\u7ec4&#xff08;table[0]&#xff09;\u5728 ctypes \u91cc\u6ca1\u6cd5\u76f4\u63a5\u58f0\u660e\u3002\u6211\u7528\u6307\u9488\u504f\u79fb\u7684\u65b9\u5f0f\u7ed5\u8fc7&#xff1a;<\/p>\n<p>table &#061; ctypes.cast(buf, ctypes.POINTER(MIB_TCPTABLE_OWNER_PID)).contents<br \/>\nnum &#061; table.dwNumEntries<br \/>\nrow_ptr &#061; ctypes.pointer(table.table[0]) \u00a0# \u62ff\u9996\u884c\u5730\u5740\u5f53\u57fa\u5740<br \/>\n\u200b<br \/>\nfor i in range(num):<br \/>\n \u00a0 \u00a0row &#061; row_ptr[i] \u00a0# \u6307\u9488\u7b97\u672f&#xff0c;\u6309 sizeof(row) \u6b65\u8fdb<br \/>\n \u00a0 \u00a0local_ip &#061; socket.inet_ntoa(struct.pack(&#039;&lt;I&#039;, row.dwLocalAddr))<br \/>\n \u00a0 \u00a0local_port &#061; socket.ntohs(row.dwLocalPort &amp; 0xFFFF)<br \/>\n \u00a0 \u00a0# &#8230; <\/p>\n<h4>\u5b57\u8282\u5e8f\u7684\u90a3\u70b9\u4e8b\u513f<\/h4>\n<p>Windows API \u91cc IP \u5730\u5740\u662f\u4e3b\u673a\u5b57\u8282\u5e8f\u7684 DWORD&#xff0c;\u7aef\u53e3\u53f7\u5374\u662f\u7f51\u7edc\u5b57\u8282\u5e8f\u5b58\u4e8e\u4f4e 16 \u4f4d\u3002\u8f6c\u6362\u51fd\u6570\u5982\u4e0b&#xff1a;<\/p>\n<p>def _dw_to_ip(dw_addr):<br \/>\n \u00a0 \u00a0return socket.inet_ntoa(struct.pack(&#039;&lt;I&#039;, dw_addr))<br \/>\n\u200b<br \/>\ndef _dw_to_port(dw_port):<br \/>\n \u00a0 \u00a0return socket.ntohs(dw_port &amp; 0xFFFF)<br \/>\n\u200b<br \/>\ndef _port_to_dw(port):<br \/>\n \u00a0 \u00a0return socket.htons(port) \u00a0# \u7528\u4e8e SetTcpEntry <\/p>\n<p>\u8dd1\u8d77\u6765\u7684\u90a3\u4e00\u523b&#xff0c;\u5c4f\u5e55\u4e0a\u5237\u51fa\u4e86\u548c netstat -ano \u4e00\u6a21\u4e00\u6837\u7684\u6570\u636e\u2014\u2014\u4f46\u8fd9\u6b21&#xff0c;\u6570\u636e\u662f\u6211\u4ece\u5e95\u5c42 API \u91cc\u4eb2\u624b\u201c\u635e\u201d\u51fa\u6765\u7684\u3002<\/p>\n<hr \/>\n<h3>0x03 \u653b\u575a\u96be\u70b9\u4e8c&#xff1a;PyQt5 \u591a\u7ebf\u7a0b\u4e0e UI \u5b89\u5168\u66f4\u65b0<\/h3>\n<p>\u6709\u4e86\u6570\u636e&#xff0c;\u8fd8\u5f97\u6709\u4e2a\u6f02\u4eae\u7684\u201c\u7a97\u53e3\u201d\u8ba9\u7528\u6237\u770b\u3002<\/p>\n<h4>\u4fe1\u53f7\u69fd\u662f\u8de8\u7ebf\u7a0b\u901a\u4fe1\u7684\u547d\u8109<\/h4>\n<p>Qt \u5f3a\u5236\u8981\u6c42\u6240\u6709 UI \u63a7\u4ef6\u64cd\u4f5c\u5fc5\u987b\u5728\u4e3b\u7ebf\u7a0b\u6267\u884c&#xff0c;\u5426\u5219\u968f\u65f6\u6bb5\u9519\u8bef\u3002\u6240\u4ee5\u6211\u628a\u8017\u65f6\u4efb\u52a1\u6254\u8fdb<\/p>\n<p>QThread \u5b50\u7c7b&#xff0c;\u901a\u8fc7 pyqtSignal \u628a\u7ed3\u679c\u5b89\u5168\u201c\u53d1\u5c04\u201d\u56de\u4e3b\u7ebf\u7a0b&#xff1a;<\/p>\n<p>class ScanWorker(QThread):<br \/>\n \u00a0 \u00a0result_found &#061; pyqtSignal(dict) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 # \u53d1\u73b0\u4e00\u4e2a\u5f00\u653e\u7aef\u53e3<br \/>\n \u00a0 \u00a0progress_updated &#061; pyqtSignal(int, int) \u00a0 # \u8fdb\u5ea6\u66f4\u65b0<br \/>\n \u00a0 \u00a0scan_finished &#061; pyqtSignal(list) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# \u626b\u63cf\u5b8c\u6210<br \/>\n \u00a0 \u00a0scan_error &#061; pyqtSignal(str) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# \u51fa\u9519\u5566<br \/>\n\u200b<br \/>\n# \u5de5\u4f5c\u7ebf\u7a0b\u91cc<br \/>\ndef run(self):<br \/>\n \u00a0 \u00a0for port in ports:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if self.scanner.is_open(port):<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0self.result_found.emit({&#034;port&#034;: port, &#8230;})<br \/>\n\u200b<br \/>\n# \u4e3b\u7ebf\u7a0b\u91cc<br \/>\nworker.result_found.connect(self._on_scan_result) <\/p>\n<p>\u4fe1\u53f7\u8de8\u7ebf\u7a0b\u4f20\u9012\u65f6\u9ed8\u8ba4\u91c7\u7528\u961f\u5217\u6a21\u5f0f&#xff08;QueuedConnection&#xff09;&#xff0c;\u7edd\u5bf9\u7ebf\u7a0b\u5b89\u5168\u3002<\/p>\n<h4>\u8868\u683c\u6392\u5e8f\u7684\u5c0f\u6280\u5de7<\/h4>\n<p>\u7aef\u53e3\u53f7\u5b58\u5165 QTableWidgetItem \u65f6\u7528 setData(Qt.DisplayRole, int)&#xff1a;<\/p>\n<p>port_item &#061; QTableWidgetItem()<br \/>\nport_item.setData(Qt.DisplayRole, result[&#034;port&#034;]) \u00a0# \u5b58\u6574\u6570 <\/p>\n<p>\u8fd9\u6837\u70b9\u51fb\u8868\u5934\u6392\u5e8f\u65f6\u662f\u6309\u6570\u503c\u5927\u5c0f\u6392&#xff0c;\u800c\u4e0d\u662f\u6309\u5b57\u7b26\u4e32\u6392\u2014\u2014\u5426\u5219 \u201c9\u201d \u4f1a\u6392\u5728 \u201c80\u201d \u540e\u9762&#xff0c;\u90a3\u753b\u9762\u592a\u7f8e\u6211\u4e0d\u6562\u770b\u3002<\/p>\n<hr \/>\n<h3>0x04 \u653b\u575a\u96be\u70b9\u4e09&#xff1a;I\/O \u5bc6\u96c6\u578b\u4efb\u52a1\u7684\u5e76\u53d1\u4e0e\u534f\u4f5c\u53d6\u6d88<\/h3>\n<p>\u7aef\u53e3\u626b\u63cf\u662f\u5178\u578b\u7684 I\/O \u5bc6\u96c6\u578b\u4efb\u52a1&#xff0c;socket.connect_ex \u5927\u90e8\u5206\u65f6\u95f4\u5728\u7b49\u5f85\u54cd\u5e94\u6216\u8d85\u65f6\u3002<\/p>\n<h4>ThreadPoolExecutor \u6279\u91cf\u63d0\u4ea4<\/h4>\n<p>with ThreadPoolExecutor(max_workers&#061;self.threads) as executor:<br \/>\n \u00a0 \u00a0future_to_port &#061; {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0executor.submit(self.scan_port, port): port<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0for port in range(self.start_port, self.end_port &#043; 1)<br \/>\n \u00a0  }<br \/>\n \u00a0 \u00a0<br \/>\n \u00a0 \u00a0for future in as_completed(future_to_port):<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if self._cancelled: \u00a0 # \u534f\u4f5c\u5f0f\u53d6\u6d88\u68c0\u67e5<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0break<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0port &#061; future_to_port[future]<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0is_open &#061; future.result()<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if is_open:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# \u56de\u8c03\u901a\u77e5 UI <\/p>\n<p>Python \u7684 GIL \u5728 I\/O \u963b\u585e\u65f6\u4f1a\u91ca\u653e&#xff0c;\u6240\u4ee5\u591a\u7ebf\u7a0b\u5bf9\u626b\u63cf\u541e\u5410\u91cf\u7684\u63d0\u5347\u662f\u5b9e\u6253\u5b9e\u7684\u3002<\/p>\n<h4>\u534f\u4f5c\u5f0f\u53d6\u6d88&#xff1a;\u4e0d\u6740\u7ebf\u7a0b&#xff0c;\u53ea\u505c\u811a\u6b65<\/h4>\n<p>\u7528\u6237\u70b9\u4e86\u201c\u53d6\u6d88\u201d\u600e\u4e48\u529e&#xff1f;\u66b4\u529b\u6740\u7ebf\u7a0b\u4f1a\u7559\u4e0b\u5404\u79cd\u4e0d\u5e72\u51c0\u7684\u72b6\u6001\u3002\u6211\u91c7\u7528\u534f\u4f5c\u5f0f\u53d6\u6d88&#xff1a;<\/p>\n<p>def cancel(self):<br \/>\n    self._cancelled &#061; True  # \u8bbe\u7f6e\u6807\u5fd7<\/p>\n<p># \u5728 as_completed \u5faa\u73af\u4e2d\u6bcf\u4e2a Future \u5b8c\u6210\u65f6\u68c0\u67e5<br \/>\nfor future in as_completed(future_to_port):<br \/>\n    if self._cancelled:<br \/>\n        break<br \/>\n    # &#8230; <\/p>\n<p>\u4e0d\u5f3a\u884c\u4e2d\u65ad\u6b63\u5728\u6267\u884c\u7684 connect_ex&#xff0c;\u53ea\u662f\u4e0d\u518d\u5904\u7406\u65b0\u7684\u7ed3\u679c\u3002\u5e72\u51c0\u3001\u5b89\u5168\u3001\u4f18\u96c5\u3002<\/p>\n<h4>\u5b9e\u6d4b\u541e\u5410\u91cf<\/h4>\n<p>\u5728 300 \u7ebf\u7a0b\u30010.5 \u79d2\u8d85\u65f6\u4e0b&#xff0c;\u5bf9\u672c\u673a 1\u201365535 \u5168\u7aef\u53e3\u626b\u63cf&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u8017\u65f6&#xff1a;109.83 \u79d2<\/p>\n<\/li>\n<li>\n<p>\u541e\u5410\u91cf&#xff1a;\u7ea6 597 \u7aef\u53e3\/\u79d2<\/p>\n<\/li>\n<\/ul>\n<table>\n<tr>\u7ebf\u7a0b\u6570\u8017\u65f6&#xff08;\u79d2&#xff09;\u541e\u5410\u91cf&#xff08;\u7aef\u53e3\/\u79d2&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>100<\/td>\n<td>\u2248 180<\/td>\n<td>\u2248 364<\/td>\n<\/tr>\n<tr>\n<td>300<\/td>\n<td>109.83<\/td>\n<td>\u2248 597<\/td>\n<\/tr>\n<tr>\n<td>500<\/td>\n<td>\u2248 95<\/td>\n<td>\u2248 690<\/td>\n<\/tr>\n<tr>\n<td>1000<\/td>\n<td>\u2248 90<\/td>\n<td>\u2248 728<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ece 500 \u5230 1000 \u6536\u76ca\u9012\u51cf&#xff0c;\u8bf4\u660e\u672c\u673a\u626b\u63cf\u74f6\u9888\u5df2\u4ece\u5e76\u53d1\u5ea6\u8f6c\u5411\u7cfb\u7edf socket \u5904\u7406\u80fd\u529b\u3002<\/p>\n<hr \/>\n<h3>0x05 \u77e5\u8bc6\u5de5\u7a0b&#xff1a;\u7aef\u53e3\u98ce\u9669\u5e93\u4e0e OS \u6307\u7eb9\u7b97\u6cd5<\/h3>\n<p>\u626b\u51fa\u7aef\u53e3\u53ea\u662f\u7b2c\u4e00\u6b65&#xff0c;\u8ba9\u7528\u6237\u770b\u61c2\u624d\u662f\u672c\u4e8b\u3002<\/p>\n<h4>\u7aef\u53e3\u77e5\u8bc6\u5e93&#xff08;107&#043; \u6761\u76ee&#xff09;<\/h4>\n<p>JSON \u683c\u5f0f&#xff0c;\u7ed3\u6784\u6e05\u6670&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;445&#034;: {<br \/>\n    &#034;service&#034;: &#034;SMB&#034;,<br \/>\n    &#034;protocol&#034;: &#034;tcp&#034;,<br \/>\n    &#034;risk&#034;: &#034;danger&#034;,<br \/>\n    &#034;description&#034;: &#034;Windows\u6587\u4ef6\u5171\u4eab&#034;,<br \/>\n    &#034;hazard&#034;: &#034;\u52d2\u7d22\u75c5\u6bd2(WannaCry)\u4e3b\u8981\u4f20\u64ad\u901a\u9053&#xff0c;\u6c38\u6052\u4e4b\u84dd(MS17-010)\u5229\u7528\u6b64\u7aef\u53e3&#034;<br \/>\n  },<br \/>\n  &#034;22&#034;: {<br \/>\n    &#034;service&#034;: &#034;SSH&#034;,<br \/>\n    &#034;protocol&#034;: &#034;tcp&#034;,<br \/>\n    &#034;risk&#034;: &#034;safe&#034;,<br \/>\n    &#034;description&#034;: &#034;\u5b89\u5168Shell\u8fdc\u7a0b\u767b\u5f55&#034;,<br \/>\n    &#034;hazard&#034;: &#034;\u82e5\u4f7f\u7528\u5f31\u5bc6\u7801\u6216\u65e7\u7248\u672c&#xff0c;\u53ef\u80fd\u88ab\u66b4\u529b\u7834\u89e3&#034;<br \/>\n  }<br \/>\n} <\/p>\n<p>\u56db\u7ea7\u98ce\u9669\u5206\u7c7b &#043; \u5bf9\u5e94\u989c\u8272&#xff1a;<\/p>\n<table>\n<tr>\u7b49\u7ea7\u6807\u7b7e\u989c\u8272\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>safe<\/td>\n<td>\u6b63\u5e38<\/td>\n<td>#27ae60<\/td>\n<td>22\/SSH, 443\/HTTPS<\/td>\n<\/tr>\n<tr>\n<td>warning<\/td>\n<td>\u8b66\u544a<\/td>\n<td>#f39c12<\/td>\n<td>21\/FTP, 25\/SMTP<\/td>\n<\/tr>\n<tr>\n<td>danger<\/td>\n<td>\u5371\u9669<\/td>\n<td>#e74c3c<\/td>\n<td>445\/SMB, 3389\/RDP<\/td>\n<\/tr>\n<tr>\n<td>unknown<\/td>\n<td>\u672a\u77e5<\/td>\n<td>#95a5a6<\/td>\n<td>49152&#043; \u52a8\u6001\u7aef\u53e3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>OS \u6307\u7eb9\u8bc6\u522b&#xff1a;\u52a0\u6743\u8bc4\u5206\u7b97\u6cd5<\/h4>\n<p>\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u5178\u578b\u7aef\u53e3\u7ec4\u5408\u4e0d\u540c&#xff1a;<\/p>\n<ul>\n<li>\n<p>Windows&#xff1a;135, 139, 445, 3389<\/p>\n<\/li>\n<li>\n<p>Linux&#xff1a;22, 80, 443<\/p>\n<\/li>\n<li>\n<p>macOS&#xff1a;22, 548, 445<\/p>\n<\/li>\n<\/ul>\n<p>\u8bc4\u5206\u89c4\u5219&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7aef\u53e3\u5339\u914d&#xff1a;&#043;10 \u5206\/\u4e2a<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u540d\u5339\u914d&#xff1a;&#043;15 \u5206\/\u4e2a<\/p>\n<\/li>\n<li>\n<p>\u7f6e\u4fe1\u5ea6 &#061; \u6700\u9ad8\u5206 \/ (\u5f00\u653e\u7aef\u53e3\u6570 \u00d7 15) \u00d7 100&#xff0c;\u4e0a\u9650 100%<\/p>\n<\/li>\n<\/ul>\n<p>def _is_windows(self, open_ports):<br \/>\n    return any(p in open_ports for p in [135, 139, 445, 3389, 1433, 5985, 5986])<\/p>\n<p># \u82e5\u68c0\u6d4b\u5230 Windows \u5178\u578b\u7aef\u53e3&#xff0c;\u7f6e\u4fe1\u5ea6\u4e0b\u9650\u76f4\u63a5\u62c9\u5230 70% <\/p>\n<p>\u5b9e\u6d4b\u626b\u5230 [135, 139, 445, 3389] \u65f6&#xff0c;\u51c6\u786e\u8bc6\u522b\u4e3a Windows 10\u3002<\/p>\n<h4>\u6f0f\u6d1e\u5339\u914d\u5e93&#xff08;20&#043; CVE&#xff09;<\/h4>\n<p>\u5185\u7f6e\u4e09\u7ec4\u6f0f\u6d1e&#xff1a;<\/p>\n<ul>\n<li>\n<p>Windows \u7ec4&#xff1a;\u6c38\u6052\u4e4b\u84dd(CVE-2017-0144)\u3001SMBGhost(CVE-2020-0796)\u3001BlueKeep(CVE-2019-0708)<\/p>\n<\/li>\n<li>\n<p>Linux \u7ec4&#xff1a;SSH\u3001MySQL\u3001Redis \u76f8\u5173<\/p>\n<\/li>\n<li>\n<p>\u901a\u7528\u7ec4&#xff1a;FTP\u3001Telnet\u3001SNMP<\/p>\n<\/li>\n<\/ul>\n<p>\u5339\u914d\u903b\u8f91&#xff1a;\u7aef\u53e3 \u2192 \u670d\u52a1\u7c7b\u578b \u2192 \u6f0f\u6d1e\u6761\u76ee \u2192 \u7ed3\u5408 OS \u7c7b\u578b\u8fc7\u6ee4\u3002\u5bf9 445 &#043; 3389 \u7684 Windows \u4e3b\u673a&#xff0c;\u4e00\u6b21\u6027\u547d\u4e2d 4 \u4e2a Critical \u7ea7\u6f0f\u6d1e\u3002<\/p>\n<hr \/>\n<h3>0x06 \u5b9e\u6218\u9a8c\u6536&#xff1a;109 \u79d2\u626b\u63cf 6.5 \u4e07\u7aef\u53e3<\/h3>\n<h4>\u6d4b\u8bd5\u73af\u5883<\/h4>\n<table>\n<tr>\u9879\u76ee\u914d\u7f6e<\/tr>\n<tbody>\n<tr>\n<td>\u64cd\u4f5c\u7cfb\u7edf<\/td>\n<td>Windows 10 19045<\/td>\n<\/tr>\n<tr>\n<td>CPU<\/td>\n<td>Intel i7-10700K&#xff08;8 \u6838 16 \u7ebf\u7a0b&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58<\/td>\n<td>31.72 GB<\/td>\n<\/tr>\n<tr>\n<td>Python<\/td>\n<td>3.11.3<\/td>\n<\/tr>\n<tr>\n<td>PyQt5<\/td>\n<td>5.15.11<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u5168\u7aef\u53e3\u626b\u63cf\u7ed3\u679c<\/h4>\n<p>2026-08-04 20:22:07 [INFO] \u3010\u5f00\u59cb\u7aef\u53e3\u626b\u63cf\u3011 \u76ee\u6807: 127.0.0.1  \u8303\u56f4: 1-65535<br \/>\n2026-08-04 20:22:08 [INFO]   [\u53d1\u73b0] 135\/tcp MS-RPC \u5371\u9669<br \/>\n2026-08-04 20:22:08 [INFO]   [\u53d1\u73b0] 445\/tcp SMB \u5371\u9669<br \/>\n2026-08-04 20:22:12 [INFO]   [\u53d1\u73b0] 3389\/tcp RDP \u5371\u9669<br \/>\n&#8230;<br \/>\n2026-08-04 20:23:57 [INFO] \u3010\u626b\u63cf\u5b8c\u6210\u3011 \u8017\u65f6: 109.83\u79d2  \u5f00\u653e\u7aef\u53e3: 24\u4e2a<br \/>\n2026-08-04 20:23:57 [WARNING]   \u26a0 \u68c0\u6d4b\u5230 3 \u4e2a\u9ad8\u5371\u7aef\u53e3&#xff01;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"555\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151641-6a720259b06aa.png\" width=\"960\" \/><\/p>\n<h4>\u6d3b\u52a8\u8fde\u63a5\u76d1\u63a7<\/h4>\n<p>\u7a0b\u5e8f\u542f\u52a8\u540e\u81ea\u52a8\u62c9\u53d6\u672c\u673a\u8fde\u63a5\u8868&#xff0c;100 \u6761\u8fde\u63a5\u7a33\u5b9a\u89e3\u6790&#xff1a;<\/p>\n<p>TCP 192.168.6.125:56146 -&gt; 27.222.17.33:443 [ESTABLISHED] PID:14632 (Trae CN.exe)<br \/>\nTCP 192.168.6.125:57956 -&gt; 52.242.103.142:443 [ESTABLISHED] PID:11304 (msedge.exe)<br \/>\nUDP 192.168.6.125:137 -&gt; *:0 [UDP] PID:4 (System)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"566\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151641-6a720259ec116.png\" width=\"976\" \/><\/p>\n<p>PID \u5230\u8fdb\u7a0b\u540d\u7684\u6620\u5c04\u51c6\u786e\u65e0\u8bef\u2014\u2014PID 4 \u662f \u201cSystem\u201d&#xff0c;PID 11304 \u662f \u201cmsedge.exe (11304)\u201d&#xff0c;\u4e0e\u4efb\u52a1\u7ba1\u7406\u5668\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n<h4>\u53f3\u952e\u83dc\u5355\u529f\u80fd\u77e9\u9635<\/h4>\n<p>\u4e24\u4e2a\u8868\u683c\u5171\u96c6\u6210\u4e86 19 \u9879\u53f3\u952e\u529f\u80fd&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"726\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151642-6a72025a213ca.png\" width=\"995\" \/><\/p>\n<table>\n<tr>\u83dc\u5355\u9879\u9002\u7528\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>\u590d\u5236\u7aef\u53e3 \/ \u590d\u5236\u5b8c\u6574\u4fe1\u606f<\/td>\n<td>\u7aef\u53e3\u626b\u63cf\u7ed3\u679c<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u627e\u8be5\u7aef\u53e3\u7684\u670d\u52a1\u9879&#xff08;\u672c\u673a&#xff09;<\/td>\n<td>\u5b9a\u4f4d\u5360\u7528\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>\u901a\u8fc7\u9632\u706b\u5899\u5173\u95ed\/\u6253\u5f00\u8be5\u7aef\u53e3<\/td>\n<td>\u672c\u673a\u5feb\u901f\u5c01\u7981<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5df2\u77e5\u6f0f\u6d1e \/ \u5728\u7ebf\u641c\u7d22 CVE<\/td>\n<td>\u5b89\u5168\u8bc4\u4f30<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u7f51\u7edc\u68c0\u7d22 \/ \u5927\u6a21\u578b\u5206\u6790<\/td>\n<td>\u77e5\u8bc6\u6269\u5c55<\/td>\n<\/tr>\n<tr>\n<td>\u5173\u95ed\u8be5\u8fde\u63a5&#xff08;TCP&#xff09;<\/td>\n<td>\u7d27\u6025\u65ad\u8fde&#xff08;\u9700\u7ba1\u7406\u5458&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u7ed3\u675f\u8fdb\u7a0b \/ \u67e5\u770b\u8fdb\u7a0b\u8be6\u60c5<\/td>\n<td>\u5f02\u5e38\u8fdb\u7a0b\u5904\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>WHOIS \/ IP \u5f52\u5c5e\u5730\u67e5\u8be2<\/td>\n<td>\u6eaf\u6e90\u5206\u6790<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>0x07 \u8e29\u5751\u8bb0&#xff1a;\u90a3\u4e9b\u5e74\u6211\u6389\u8fdb\u53bb\u7684\u5751<\/h3>\n<li>\n<p>ctypes.Structure \u7684\u5b57\u8282\u5bf9\u9f50 Windows API \u7ed3\u6784\u4f53\u9ed8\u8ba4 #pragma pack(8)&#xff0c;ctypes \u9ed8\u8ba4\u662f 4 \u5b57\u8282\u5bf9\u9f50\u3002\u6211\u7528 _pack_ &#061; 1 \u6216 _pack_ &#061; 8 \u5f3a\u5236\u5339\u914d&#xff0c;\u5426\u5219\u504f\u79fb\u91cf\u5168\u9519\u3002<\/p>\n<\/li>\n<li>\n<p>UDP \u8fde\u63a5\u7684 remote_addr \u89e3\u6790 UDP \u662f\u65e0\u8fde\u63a5\u7684&#xff0c;dwRemoteAddr \u53ef\u80fd\u4e3a 0x00000000&#xff0c;dwRemotePort \u4e3a 0\u3002inet_ntoa \u4e0d\u80fd\u5904\u7406\u5168\u96f6\u5730\u5740&#xff0c;\u5f97\u7279\u5224\u3002<\/p>\n<\/li>\n<li>\n<p>SetTcpEntry \u8fd4\u56de ERROR_ACCESS_DENIED \u975e\u7ba1\u7406\u5458\u6743\u9650\u4e0b\u5173\u95ed\u8fde\u63a5\u5fc5\u5931\u8d25\u3002\u6211\u5728 UI \u4e0a\u660e\u786e\u63d0\u793a\u201c\u8bf7\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u201d&#xff0c;\u5e76\u628a\u9519\u8bef\u7801\u6620\u5c04\u6210\u4e2d\u6587\u63d0\u793a\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u7a0b\u540d\u7f13\u5b58\u8fc7\u671f ConnectionManager \u542f\u52a8\u65f6\u7528 psutil \u4e00\u6b21\u6027\u7f13\u5b58\u6240\u6709\u8fdb\u7a0b\u540d\u3002\u4f46\u626b\u63cf\u8fc7\u7a0b\u4e2d\u65b0\u8fdb\u7a0b\u542f\u52a8\u4e0d\u4f1a\u5237\u65b0\u3002\u6211\u7684\u5bf9\u7b56\u662f&#xff1a;\u7f13\u5b58\u547d\u4e2d\u76f4\u63a5\u8fd4\u56de&#xff0c;\u672a\u547d\u4e2d\u65f6\u5355\u6b21\u67e5\u8be2\u5e76\u8865\u5145\u5165\u7f13\u5b58\u2014\u2014\u201c\u9884\u53d6 &#043; \u61d2\u52a0\u8f7d\u201d\u7b56\u7565\u3002<\/p>\n<\/li>\n<li>\n<p>\u5df2\u77e5\u7aef\u53e3\u626b\u63cf\u7684\u7aef\u53e3\u5217\u8868\u6765\u6e90 \u5982\u679c port_database.json \u52a0\u8f7d\u5931\u8d25&#xff0c;get_all_known_ports() \u8fd4\u56de\u7a7a\u5217\u8868\u3002\u6211\u5728\u521d\u59cb\u5316\u65f6\u52a0\u4e86 fallback \u7a7a\u6570\u636e\u5e93&#xff0c;\u5e76\u6253\u5370\u8b66\u544a\u3002<\/p>\n<\/li>\n<hr \/>\n<h3>0x08 \u9879\u76ee\u5f00\u6e90\u4e0e\u540e\u7eed\u5c55\u671b<\/h3>\n<p>PortSentinel v0.08 \u5df2\u5b8c\u6574\u5f00\u6e90&#xff0c;\u91c7\u7528 GPL v3 \u534f\u8bae\u3002\u9879\u76ee\u5730\u5740&#xff1a;<\/p>\n<p>&#x1f449; github.com\/donoot\/PortSentinel<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u60f3\u81ea\u5df1\u52a8\u624b\u6539\u4e00\u7248&#xff0c;\u6216\u8005\u53d1\u73b0 bug \u60f3\u63d0 issue&#xff0c;\u975e\u5e38\u6b22\u8fce\u3002<\/p>\n<h4>\u672a\u6765\u8fed\u4ee3\u65b9\u5411<\/h4>\n<li>\n<p>SYN \u534a\u5f00\u626b\u63cf&#xff1a;\u63a5\u5165 WinPcap\/Npcap&#xff0c;\u63d0\u5347\u626b\u63cf\u901f\u7387<\/p>\n<\/li>\n<li>\n<p>Banner \u6293\u53d6 &#043; TTL \u63a2\u6d4b&#xff1a;OS \u6307\u7eb9\u7cbe\u5ea6\u518d\u5347\u4e00\u6863<\/p>\n<\/li>\n<li>\n<p>AI \u5a01\u80c1\u5206\u6790&#xff1a;\u628a\u7aef\u53e3 &#043; CVE \u6458\u8981\u5582\u7ed9\u5927\u8bed\u8a00\u6a21\u578b&#xff0c;\u8f93\u51fa\u81ea\u7136\u8bed\u8a00\u52a0\u56fa\u65b9\u6848<\/p>\n<\/li>\n<li>\n<p>\u4e91\u7aef\u6f0f\u6d1e\u5e93\u540c\u6b65&#xff1a;\u5bf9\u63a5 NVD&#xff0c;\u6bcf\u5468\u81ea\u52a8\u62c9\u53d6\u6700\u65b0 CVE<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u65f6\u8fde\u63a5\u63a8\u9001&#xff1a;\u57fa\u4e8e ETW&#xff08;Event Tracing for Windows&#xff09;\u76d1\u63a7\u8fde\u63a5\u53d8\u5316<\/p>\n<\/li>\n<hr \/>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>\u4ece\u90a3\u4e2a\u53d1\u73b0\u6ee1\u5c4f\u5f00\u653e\u7aef\u53e3\u7684\u65e9\u6668&#xff0c;\u5230 PortSentinel \u8dd1\u901a\u5168\u7aef\u53e3\u626b\u63cf&#xff0c;\u524d\u540e\u4e0d\u8fc7\u6570\u65e5\u3002<\/p>\n<p>\u56de\u987e\u8fd9\u6bb5\u7ecf\u5386&#xff0c;\u6700\u5927\u7684\u611f\u89e6\u662f&#xff1a;Windows \u5e95\u5c42 API \u6ca1\u90a3\u4e48\u53ef\u6015\u3002 iphlpapi.dll \u5c31\u5728\u90a3\u91cc&#xff0c;ctypes \u5c31\u662f\u90a3\u5ea7\u6865\u3002\u4e24\u6b21\u8c03\u7528\u3001\u6307\u9488\u7b97\u672f\u3001\u5b57\u8282\u5e8f\u8f6c\u6362\u2014\u2014\u641e\u61c2\u4e86&#xff0c;\u4f60\u5c31\u62e5\u6709\u4e86\u548c netstat \u4e00\u6837\u7684\u80fd\u529b&#xff0c;\u8fd8\u591a\u51fa\u4e86\u5f3a\u5236\u5173\u95ed\u8fde\u63a5\u7684\u8d85\u80fd\u529b\u3002<\/p>\n<p>\u800c PyQt5 &#043; QThread &#043; \u4fe1\u53f7\u69fd \u7684\u7ec4\u5408&#xff0c;\u662f\u684c\u9762 GUI \u5e94\u7528\u5f00\u53d1\u7684\u9ec4\u91d1\u642d\u6863\u3002\u5de5\u4f5c\u7ebf\u7a0b\u5e72\u91cd\u6d3b&#xff0c;\u4fe1\u53f7\u628a\u7ed3\u679c\u5b89\u5168\u9001\u56de\u4e3b\u7ebf\u7a0b\u2014\u2014UI \u4e0d\u5361&#xff0c;\u6570\u636e\u4e0d\u9519\u3002<\/p>\n<p>\u6700\u91cd\u8981\u7684\u662f&#xff0c;\u77e5\u8bc6\u5e93\u8ba9\u5de5\u5177\u6709\u4e86\u201c\u7075\u9b42\u201d\u3002107&#043; \u7aef\u53e3\u7684\u98ce\u9669\u5206\u7ea7\u300120&#043; CVE \u7684\u6f0f\u6d1e\u5339\u914d\u2014\u2014\u8fd9\u4e9b\u8ba9\u4e00\u4e2a\u51b7\u51b0\u51b0\u7684\u626b\u63cf\u5668\u53d8\u6210\u4e86\u80fd\u7ed9\u51fa\u5b89\u5168\u5efa\u8bae\u7684\u987e\u95ee\u3002<\/p>\n<p>\u95e8\u5c31\u5728\u90a3\u91cc&#xff0c;\u63a8\u5f00\u5b83\u3002<\/p>\n<hr \/>\n<p>\u9879\u76ee\u6807\u7b7e&#xff1a;#Python #PyQt5 #\u7f51\u7edc\u5b89\u5168 #\u7aef\u53e3\u626b\u63cf #Windows API #ctypes #\u5f00\u6e90<\/p>\n<p>\u4f5c\u8005&#xff1a;donoot \u65e5\u671f&#xff1a;2026-08-04 \u7248\u672c&#xff1a;PortSentinel v0.08<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u522b\u518d\u4e0b\u90a3\u4e9b\u6765\u8def\u4e0d\u660e\u7684\u7eff\u8272\u7248\u4e86&#xff0c;\u6211\u7528 Python \u624b\u6413\u4e86\u4e00\u4e2a\u7aef\u53e3\u626b\u63cf\u4e0e\u5b89\u5168\u76d1\u63a7\u5de5\u5177\u3002 0x00 \u5f15\u5b50&#xff1a;\u65b0\u673a\u521d\u542f&#xff0c;\u767e\u201c\u5b54\u201d\u96be\u5b89<br \/>\n\u6545\u4e8b\u53d1\u751f\u5728 2026 \u5e74 8 \u6708 4 \u65e5\u7684\u6e05\u6668\u3002<br \/>\n\u65b0\u914d\u7684\u53f0\u5f0f\u673a\u5230\u4e86&#xff0c;Windows 10 \u7cfb\u7edf\u6e05\u723d\u5f97\u50cf\u4e00\u5f20\u767d\u7eb8\u3002\u4f5c\u4e3a\u4e00\u4e2a\u624b\u75d2\u96be\u8010\u7684\u5b89\u5168\u7231\u597d\u8005&#xff0c;\u6211\u4e60\u60ef\u6027\u5730\u6572\u4e0b\u4e86\u90a3\u6761\u523b\u5728 Windows \u7ba1\u7406\u5458 DNA \u91cc\u7684\u547d\u4ee4&#xff1a; netstat -ano\u5c4f\u5e55\u77ac\u95f4\u6eda\u51fa\u5bc6\u5bc6\u9ebb\u9ebb\u7684\u5217\u8868\u3002\u4e00<\/p>\n","protected":false},"author":2,"featured_media":90249,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10272,10273,10271,10274,122],"topic":[],"class_list":["post-90254","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-netstat-ano","tag-ctypes","tag-portsentinel","tag-pyqt5-","tag-122"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/90254.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u522b\u518d\u4e0b\u90a3\u4e9b\u6765\u8def\u4e0d\u660e\u7684\u7eff\u8272\u7248\u4e86&#xff0c;\u6211\u7528 Python \u624b\u6413\u4e86\u4e00\u4e2a\u7aef\u53e3\u626b\u63cf\u4e0e\u5b89\u5168\u76d1\u63a7\u5de5\u5177\u3002 0x00 \u5f15\u5b50&#xff1a;\u65b0\u673a\u521d\u542f&#xff0c;\u767e\u201c\u5b54\u201d\u96be\u5b89 \u6545\u4e8b\u53d1\u751f\u5728 2026 \u5e74 8 \u6708 4 \u65e5\u7684\u6e05\u6668\u3002 \u65b0\u914d\u7684\u53f0\u5f0f\u673a\u5230\u4e86&#xff0c;Windows 10 \u7cfb\u7edf\u6e05\u723d\u5f97\u50cf\u4e00\u5f20\u767d\u7eb8\u3002\u4f5c\u4e3a\u4e00\u4e2a\u624b\u75d2\u96be\u8010\u7684\u5b89\u5168\u7231\u597d\u8005&#xff0c;\u6211\u4e60\u60ef\u6027\u5730\u6572\u4e0b\u4e86\u90a3\u6761\u523b\u5728 Windows \u7ba1\u7406\u5458 DNA \u91cc\u7684\u547d\u4ee4&#xff1a; netstat -ano\u5c4f\u5e55\u77ac\u95f4\u6eda\u51fa\u5bc6\u5bc6\u9ebb\u9ebb\u7684\u5217\u8868\u3002\u4e00\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/90254.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-04T15:16:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151640-6a720258e3bea.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90254.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/90254.html\",\"name\":\"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-04T15:16:43+00:00\",\"dateModified\":\"2026-08-04T15:16:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/90254.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/90254.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90254.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/90254.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u522b\u518d\u4e0b\u90a3\u4e9b\u6765\u8def\u4e0d\u660e\u7684\u7eff\u8272\u7248\u4e86&#xff0c;\u6211\u7528 Python \u624b\u6413\u4e86\u4e00\u4e2a\u7aef\u53e3\u626b\u63cf\u4e0e\u5b89\u5168\u76d1\u63a7\u5de5\u5177\u3002 0x00 \u5f15\u5b50&#xff1a;\u65b0\u673a\u521d\u542f&#xff0c;\u767e\u201c\u5b54\u201d\u96be\u5b89 \u6545\u4e8b\u53d1\u751f\u5728 2026 \u5e74 8 \u6708 4 \u65e5\u7684\u6e05\u6668\u3002 \u65b0\u914d\u7684\u53f0\u5f0f\u673a\u5230\u4e86&#xff0c;Windows 10 \u7cfb\u7edf\u6e05\u723d\u5f97\u50cf\u4e00\u5f20\u767d\u7eb8\u3002\u4f5c\u4e3a\u4e00\u4e2a\u624b\u75d2\u96be\u8010\u7684\u5b89\u5168\u7231\u597d\u8005&#xff0c;\u6211\u4e60\u60ef\u6027\u5730\u6572\u4e0b\u4e86\u90a3\u6761\u523b\u5728 Windows \u7ba1\u7406\u5458 DNA \u91cc\u7684\u547d\u4ee4&#xff1a; netstat -ano\u5c4f\u5e55\u77ac\u95f4\u6eda\u51fa\u5bc6\u5bc6\u9ebb\u9ebb\u7684\u5217\u8868\u3002\u4e00","og_url":"https:\/\/www.wsisp.com\/helps\/90254.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-04T15:16:43+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260804151640-6a720258e3bea.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/90254.html","url":"https:\/\/www.wsisp.com\/helps\/90254.html","name":"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-04T15:16:43+00:00","dateModified":"2026-08-04T15:16:43+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/90254.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/90254.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/90254.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece netstat -ano \u5230\u81ea\u7814\u5b89\u5168\u5de5\u5177\uff1aPortSentinel \u5b9e\u6218\u5f00\u53d1\u624b\u8bb0"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=90254"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90254\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/90249"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=90254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=90254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=90254"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=90254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}