{"id":295105,"date":"2024-12-21T12:14:50","date_gmt":"2024-12-21T04:14:50","guid":{"rendered":"https:\/\/lrxjmw.cn\/lxtzrhsynmlz.html"},"modified":"2024-12-21T12:14:50","modified_gmt":"2024-12-21T04:14:50","slug":"lxtzrhsynmlz","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxtzrhsynmlz.html","title":{"rendered":"Linux\u7cfb\u7edf\u4e2d\u5982\u4f55\u4f7f\u7528netstat\u547d\u4ee4\u67e5\u770b\u7aef\u53e3\u72b6\u6001\u53ca\u89e3\u51b3\u7aef\u53e3\u51b2\u7a81\u95ee\u9898"},"content":{"rendered":"

Linux<\/a>\u7cfb\u7edf\u91cc\uff0c\u67e5\u770b\u7aef\u53e3\u7684\u6307\u4ee4\u662f\u4e2a\u5173\u952e\u6b65\u9aa4\u3002\u5b83\u80fd\u8ba9\u6211\u4eec\u638c\u63e1\u7cfb\u7edf\u7f51\u7edc\u670d\u52a1\u7684\u4f7f\u7528\u72b6\u51b5\uff0c\u6bd4\u5982\u8bc6\u522b\u54ea\u4e9b\u8f6f\u4ef6\u5360\u7528\u4e86\u67d0\u4e2a\u7aef\u53e3\uff0c\u4ee5\u53ca\u662f\u5426\u5b58\u5728\u7aef\u53e3\u51b2\u7a81\u95ee\u9898\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f1a\u8be6\u7ec6\u9610\u8ff0\u8fd9\u4e00\u8fc7\u7a0b\u3002<\/p>\n

netstat<\/a>\u547d\u4ee4<\/a><\/b><\/p>\n

netstat\u662f\u68c0\u67e5\u7f51\u7edc\u72b6\u51b5\u7684\u5e38\u7528\u5de5\u5177\u3002\u5b83\u7684\u529f\u80fd\u975e\u5e38\u5168\u9762\u3002\u82e5\u8981\u67e5\u770b\u6240\u6709\u7aef\u53e3\u7684\u76d1\u542c\u72b6\u6001\uff0c\u8f93\u5165\u201cnetstat -tunlp\u201d\u5373\u53ef\u3002\u8fd9\u91cc\u7684\u201c-t\u201d\u7528\u4e8e\u67e5\u770bTCP\u534f\u8bae\u7aef\u53e3\uff0c\u201c-u\u201d\u7528\u4e8e\u67e5\u770bUDP\u534f\u8bae\u7aef\u53e3\uff0c\u201c-n\u201d\u4ee5\u6570\u5b57\u5f62\u5f0f\u5448\u73b0\uff0c\u201c-l\u201d\u4ec5\u663e\u793a\u76d1\u542c\u7aef\u53e3\uff0c\u201c-p\u201d\u5219\u4f1a\u663e\u793a\u5360\u7528\u8fd9\u4e9b\u7aef\u53e3\u7684\u8fdb\u7a0b\u540d\u79f0\u548cPID\u3002\u6bd4\u5982\uff0c\u5f53\u7f51\u7edc\u670d\u52a1\u672a\u542f\u52a8\u6216\u6000\u7591\u7aef\u53e3\u88ab\u5360\u7528\u65f6\uff0c\u8fd9\u4e2a\u547d\u4ee4\u80fd\u8fc5\u901f\u627e\u5230\u95ee\u9898\u6240\u5728\u3002\u5728\u670d\u52a1\u5668\u7ba1\u7406\u4e2d\uff0c\u68c0\u6d4b\u7aef\u53e3\u662f\u5426\u88ab\u975e\u6cd5\u5360\u7528\u65f6\uff0c\u8fd9\u4e2a\u547d\u4ee4\u540c\u6837\u975e\u5e38\u5b9e\u7528\u3002<\/p>\n

linux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4_\u7aef\u53e3\u547d\u4ee4\u67e5\u770b_\u67e5\u770b\u7aef\u53e3\u53f7linux<\/p>\n

\u5728\u5e38\u89c4\u4fdd\u517b\u65f6\uff0c\u6211\u4eec\u80fd\u591f\u6839\u636e\u5b9e\u9645\u9700\u8981\uff0c\u7075\u6d3b\u642d\u914dnetstat\u7684\u5404\u9879\u9009\u9879\u3002\u4f8b\u5982\uff0c\u82e5\u8981\u68c0\u67e5\u4e0e\u7279\u5b9aIP\u5730\u5740\u76f8\u8fde\u63a5\u7684\u7aef\u53e3\u72b6\u6001\uff0c\u6211\u4eec\u4fbf\u53ef\u4ee5\u6dfb\u52a0\u76f8\u5e94\u7684IP\u8fc7\u6ee4\u6761\u4ef6\u3002\u8fd9\u5927\u5927\u4fbf\u5229\u4e86\u7f51\u7edc\u6545\u969c\u7684\u6392\u67e5\uff0c\u540c\u65f6\u8ba9\u7f51\u7edc\u7ba1\u7406\u4eba\u5458\u80fd\u66f4\u7cbe\u786e\u5730\u4e86\u89e3\u7f51\u7edc\u72b6\u6001\u3002<\/p>\n

lsof\u547d\u4ee4<\/b><\/p>\n

lsof\u547d\u4ee4\u5728\u7aef\u53e3\u67e5\u770b\u65b9\u9762\u6709\u5176\u72ec\u5230\u4e4b\u5904\u3002\u5b83\u80fd\u5c55\u793a\u7cfb\u7edf\u5f53\u524d\u6253\u5f00\u7684\u6587\u4ef6\u5217\u8868\u3002\u5728Linux<\/a>\u7cfb\u7edf\u4e2d\uff0c\u6240\u6709\u4e8b\u7269\uff0c\u5305\u62ec\u7f51\u7edc\u8fde\u63a5\uff0c\u90fd\u662f\u4ee5\u6587\u4ef6\u63cf\u8ff0\u7b26\u7684\u5f62\u5f0f\u5b58\u5728\u3002\u56e0\u6b64linux vi\u547d\u4ee4\uff0clsof\u80fd\u8ffd\u8e2a\u5230\u5360\u7528\u7aef\u53e3\u7684\u8fdb\u7a0b\u3002\u82e5\u8981\u67e5\u8be2\u7279\u5b9a\u7aef\u53e3\uff0c\u6bd4\u598280\u7aef\u53e3\uff0c\u4f7f\u7528\u201clsof -i:80\u201d\u5373\u53ef\u3002\u8fd9\u4e2a\u547d\u4ee4\u5728\u6392\u67e5\u56e0\u8fdb\u7a0b\u5360\u7528\u7aef\u53e3\u800c\u5bfc\u81f4\u7684Web\u670d\u52a1\u542f\u52a8\u95ee\u9898\u5341\u5206\u6709\u7528\u3002<\/p>\n

linux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4_\u7aef\u53e3\u547d\u4ee4\u67e5\u770b_\u67e5\u770b\u7aef\u53e3\u53f7linux<\/p>\n

lsof\u547d\u4ee4\u6bd4netstat\u80fd\u7ed9\u51fa\u66f4\u8be6\u5c3d\u7684\u8fdb\u7a0b\u8d44\u6599\uff0c\u6db5\u76d6\u7528\u6237\u4fe1\u606f\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u7b49\u3002\u8fd9\u5bf9\u7cfb\u7edf\u5b89\u5168\u5ba1\u67e5\u548c\u6545\u969c\u6df1\u5165\u5206\u6790\u6781\u4e3a\u5173\u952e\u3002\u5f53netstat\u663e\u793a\u7aef\u53e3\u88ab\u5360\u7528\u5374\u65e0\u6cd5\u8bc6\u522b\u662f\u54ea\u4e2a\u7a0b\u5e8f\u5f02\u5e38\u5360\u7528\u65f6\uff0clsof\u4fbf\u80fd\u53d1\u6325\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n

ss\u547d\u4ee4\u662f\u67e5\u770b\u7f51\u7edc\u7aef\u53e3\u72b6\u6001\u7b49\u591a\u79cd\u7f51\u7edc\u4fe1\u606f\u7684\u6709\u6548\u5de5\u5177\u3002\u5b83\u7684\u529f\u80fd\u4e0enetstat\u76f8\u8fd1\uff0c\u4f46\u5728\u6027\u80fd\u4e0a\u7565\u80dc\u4e00\u7b79\u3002\u6bd4\u5982\uff0c\u5f53\u4f60\u4f7f\u7528\u201css -tunlp\u201d\u6765\u67e5\u770b\u7aef\u53e3\u4f7f\u7528\u72b6\u6001\u65f6\uff0c\u5176\u663e\u793a\u7ed3\u679c\u4e0enetstat -tunlp\u76f8\u4f3c\u3002\u7136\u800c\uff0css\u547d\u4ee4\u67e5\u8be2\u901f\u5ea6\u66f4\u5feb\uff0c\u6240\u4ee5\u5728\u9762\u5bf9\u5927\u578b\u670d\u52a1\u5668\u6216\u9ad8\u5e76\u53d1\u73af\u5883\u65f6\uff0c\u901a\u5e38\u66f4\u63a8\u8350\u4f18\u5148\u4f7f\u7528\u5b83\u3002<\/p>\n

ss\u547d\u4ee4\u8f93\u51fa\u683c\u5f0f\u72ec\u7279\uff0c\u53ef\u8c03\u53c2\u6570\u4ee5\u9002\u5e94\u4e0d\u540c\u67e5\u770b\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u67e5\u770bUDP\u7aef\u53e3\u65f6\uff0c\u5b83\u80fd\u5448\u73b0\u6e05\u6670\u7b80\u77ed\u7684\u5217\u8868\uff1b\u67e5\u8be2\u8fde\u63a5\u8be6\u60c5\u65f6\uff0c\u53c8\u80fd\u63d0\u4f9b\u8be6\u5c3d\u4fe1\u606f\u3002\u8fd9\u5bf9\u8fd0\u7ef4\u4eba\u5458\u5e94\u5bf9\u4e0d\u540c\u6545\u969c\u6392\u67e5\u65b9\u5411\u6781\u4e3a\u6709\u5229\u3002<\/p>\n

nmap\u8f6f\u4ef6\u4e3b\u8981\u7528\u4e8e\u7f51\u7edc\u63a2\u6d4b\u548c\u5b89\u5168\u68c0\u67e5\u3002\u5b83\u80fd\u5e2e\u52a9\u6211\u4eec\u67e5\u770b\u54ea\u4e9b\u7aef\u53e3\u88ab\u4e3b\u673a\u6253\u5f00\u3002\u901a\u8fc7\u8f93\u5165\u201cnmap -p [\u7aef\u53e3\u53f7] [\u76ee\u6807IP]\u201d\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u6307\u5b9aIP\u5730\u5740\u7684\u7279\u5b9a\u7aef\u53e3\u8fdb\u884c\u626b\u63cf\uff0c\u786e\u8ba4\u8fd9\u4e9b\u7aef\u53e3\u662f\u5426\u5904\u4e8e\u5f00\u542f\u72b6\u6001\u3002\u8fd9\u5bf9\u4e8e\u7f51\u7edc\u5b89\u5168\u6765\u8bf4\u81f3\u5173\u91cd\u8981linux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4<\/strong>\uff0c\u5b83\u4f7f\u6211\u4eec\u80fd\u591f\u8bc6\u522b\u51fa\u54ea\u4e9b\u670d\u52a1\u5668\u7aef\u53e3\u662f\u66b4\u9732\u5728\u5916\u7684\u3002<\/p>\n

\u65b0\u8bbe\u670d\u52a1\u5668\u65f6\uff0c\u6211\u4eec\u9700\u7528nmap\u547d\u4ee4\u68c0\u67e5\u672c\u5730\u670d\u52a1\uff0c\u786e\u4fdd\u5b89\u5168\u7ec4\u89c4\u5219\u4e0e\u9700\u5f00\u653e\u7684\u7aef\u53e3\u76f8\u5339\u914d\u3002\u540c\u65f6linux\u7cfb\u7edf\u4ecb\u7ecd\uff0cnmap\u8fd8\u80fd\u63d0\u4f9b\u7aef\u53e3\u989d\u5916\u4fe1\u606f\uff0c\u6bd4\u5982\u7aef\u53e3\u8fd0\u884c\u7684\u670d\u52a1\u53ca\u9ed8\u8ba4\u534f\u8bae\u7b49\uff0c\u8fd9\u6709\u52a9\u4e8e\u9632\u8303\u7f51\u7edc\u5b89\u5168\u9690\u60a3\u3002<\/p>\n

Linux\u7aef\u53e3\u7ba1\u7406\u91cd\u8981\u6027<\/b><\/p>\n

\u7aef\u53e3\u547d\u4ee4\u67e5\u770b_\u67e5\u770b\u7aef\u53e3\u53f7linux_linux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4<\/p>\n

\u660e\u767d\u54ea\u4e9b\u7a0b\u5e8f\u5360\u7528\u4e86\u7aef\u53e3\u662f\u9879\u5173\u952e\u5de5\u4f5c\u3002\u4e0d\u8bba\u662f\u9632\u8303\u6076\u610f\u8f6f\u4ef6\u901a\u8fc7\u975e\u6cd5\u7aef\u53e3\u4f20\u8f93\u6570\u636e\uff0c\u8fd8\u662f\u786e\u4fdd\u6b63\u5e38\u4e1a\u52a1\u7aef\u53e3\u4e0d\u88ab\u5e72\u6270\uff0c\u7aef\u53e3\u7684\u7ba1\u7406\u548c\u67e5\u770b\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u5728\u5927\u578b\u6570\u636e\u4e2d\u5fc3\u6216\u4f01\u4e1a\u5185\u90e8\u7f51\u7edc\u91cclinux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4<\/strong>\uff0c\u82e5\u7aef\u53e3\u7ba1\u7406\u6742\u4e71\u65e0\u7ae0\uff0c\u53ef\u80fd\u5f15\u53d1\u4e25\u91cd\u7684\u7f51\u7edc\u6545\u969c\u548c\u4fe1\u606f\u5b89\u5168\u95ee\u9898\u3002<\/p>\n

\u82e5\u4e0d\u80fd\u51c6\u786e\u638c\u63e1\u7aef\u53e3\u7684\u4f7f\u7528\u72b6\u51b5\uff0c\u5c31\u53ef\u80fd\u96be\u4ee5\u8fc5\u901f\u53d1\u73b0\u5e76\u5904\u7406\u7f51\u7edc\u6545\u969c\u3002\u6bd4\u5982\uff0c\u5f53\u591a\u4e2a\u670d\u52a1\u7ade\u76f8\u4e89\u593a\u7aef\u53e3\u8d44\u6e90\u65f6\uff0c\u82e5\u7f3a\u4e4f\u6709\u6548\u7684\u7aef\u53e3\u68c0\u67e5\u65b9\u6cd5\uff0c\u4fbf\u65e0\u6cd5\u627e\u5230\u95ee\u9898\u7684\u6839\u672c\u6240\u5728\uff0c\u8fdb\u800c\u96be\u4ee5\u5408\u7406\u5206\u914d\u7aef\u53e3\uff0c\u786e\u4fdd\u4e1a\u52a1\u80fd\u591f\u5e73\u7a33\u987a\u7545\u5730\u8fdb\u884c\u3002<\/p>\n

\u603b\u7ed3\u4e0e\u56de\u987e<\/b><\/p>\n

linux \u67e5\u770b\u7aef\u53e3\u547d\u4ee4_\u7aef\u53e3\u547d\u4ee4\u67e5\u770b_\u67e5\u770b\u7aef\u53e3\u53f7linux<\/p>\n

netstat\u3001lsof\u3001ss\u548cnmap\u7b49\u5de5\u5177\u5728Linux\u7cfb\u7edf\u4e0a\u5404\u6709\u5176\u4f18\u52bf\u3002\u6839\u636e\u4e0d\u540c\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u6311\u9009\u6700\u5408\u9002\u7684\u5de5\u5177\u3002\u6bd4\u5982\uff0c\u65e5\u5e38\u7aef\u53e3\u68c0\u67e5\u65f6\uff0cnetstat\u6216ss\u662f\u4e0d\u9519\u7684\u9009\u62e9\uff1b\u82e5\u9700\u6df1\u5165\u4e86\u89e3\u8fdb\u7a0b\u4fe1\u606f\uff0clsof\u4f1a\u66f4\u6709\u5e2e\u52a9\uff1b\u81f3\u4e8e\u5b89\u5168\u626b\u63cf\uff0cnmap\u5219\u662f\u66f4\u5408\u9002\u7684\u9009\u62e9\u3002<\/p>\n

\u5728\u4f7f\u7528Linux\u7cfb\u7edf\u7ba1\u7406\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u662f\u5426\u66fe\u906d\u9047\u8fc7\u65e0\u6cd5\u786e\u5b9a\u7aef\u53e3\u88ab\u8c01\u5360\u7528\u7684\u56f0\u6270\uff1f\u671f\u5f85\u5927\u5bb6\u80fd\u4ea4\u6d41\u5fc3\u5f97\uff0c\u540c\u65f6\u4e5f\u6b22\u8fce\u70b9\u8d5e\u5e76\u8f6c\u53d1\u672c\u7bc7\u6587\u7ae0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux\u7cfb\u7edf\u91cc\uff0c\u67e5\u770b\u7aef\u53e3\u7684\u6307\u4ee4\u662f\u4e2a\u5173\u952e\u6b65\u9aa4\u3002\u5b83\u80fd\u8ba9\u6211\u4eec\u638c\u63e1\u7cfb\u7edf\u7f51\u7edc\u670d\u52a1\u7684\u4f7f\u7528\u72b6\u51b5\uff0c\u6bd4\u5982\u8bc6\u522b\u54ea\u4e9b\u8f6f\u4ef6\u5360\u7528\u4e86\u67d0\u4e2a\u7aef\u53e3\uff0c\u4ee5\u53ca\u662f\u5426\u5b58\u5728\u7aef\u53e3\u51b2\u7a81\u95ee\u9898\u3002\u8fd9\u4e2a\u547d\u4ee4\u5728\u6392\u67e5\u56e0\u8fdb\u7a0b\u5360\u7528\u7aef\u53e3\u800c\u5bfc\u81f4\u7684Web\u670d\u52a1\u542f\u52a8\u95ee\u9898\u5341\u5206\u6709\u7528\u3002ss\u547d\u4ee4\u662f\u67e5\u770b\u7f51\u7edc\u7aef\u53e3\u72b6\u6001\u7b49\u591a\u79cd\u7f51\u7edc\u4fe1\u606f\u7684\u6709\u6548\u5de5\u5177\u3002<\/p>\n","protected":false},"author":1,"featured_media":295106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[109,3408,5079,5078,5077],"class_list":["post-295105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-linux","tag-netstat","tag-networksecurity","tag-portconflict","tag-portstatus"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/295105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=295105"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/295105\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/295106"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=295105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=295105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=295105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}