{"id":39815,"date":"2023-09-27T03:05:56","date_gmt":"2023-09-26T19:05:56","guid":{"rendered":"\/\/www.viralrail.com\/?p=39815"},"modified":"2023-09-27T03:05:56","modified_gmt":"2023-09-26T19:05:56","slug":"sylzkjsddsjb","status":"publish","type":"post","link":"\/\/www.viralrail.com\/blog\/39815.html","title":{"rendered":"\u4f7f\u7528Linux\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305"},"content":{"rendered":"
\u968f\u7740\u7f51\u7edc\u6280\u672f\u7684\u53d1\u5c55\uff0cLinux\u64cd\u4f5c\u7cfb\u7edf\u5df2\u7ecf\u6210\u4e3a\u5f53\u4eca\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u4e00\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5404\u79cd\u5de5\u5177\u6765\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u4e86\u89e3\u7f51\u7edc\u72b6\u51b5\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u4ee5\u53ca\u5982\u4f55\u5229\u7528\u8fd9\u4e9b\u4fe1\u606f\u6765\u66f4\u597d\u5730\u7ba1\u7406\u7f51\u7edc\u3002<\/p>\n
Linux\u7cfb\u7edf\u4e2d\u6709\u8bb8\u591a\u5de5\u5177\u53ef\u4ee5\u7528\u6765\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662ftcpdump\u548cwireshark\u3002tcpdump\u662f\u4e00\u6b3e\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u6355\u83b7\u548c\u5206\u6790\u7f51\u7edc\u6570\u636e\u5305\uff0c\u5b83\u80fd\u591f\u6355\u83b7\u6307\u5b9a\u7684\u7f51\u7edc\u63a5\u53e3\u4e0a\u7684\u6570\u636e\u5305\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\u3002wireshark\u662f\u4e00\u6b3e\u56fe\u5f62\u754c\u9762\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u67e5\u770b\u3001\u5206\u6790\u548c\u7f16\u8f91\u7f51\u7edc\u6570\u636e\u5305\uff0c\u5b83\u53ef\u4ee5\u6355\u83b7\u6307\u5b9a\u7f51\u7edc\u63a5\u53e3\u4e0a\u7684\u6570\u636e\u5305\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u56fe\u5f62\u754c\u9762\u4e2d\u3002<\/p>\n
\u4f7f\u7528tcpdump\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165tcpdump\u547d\u4ee4\u5373\u53ef\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528-i\u53c2\u6570\u6307\u5b9a\u63a5\u53e3\uff0c\u4f7f\u7528-w\u53c2\u6570\u6307\u5b9a\u5b58\u50a8\u6587\u4ef6\uff0c\u4f7f\u7528-r\u53c2\u6570\u6307\u5b9a\u8bfb\u53d6\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6355\u83b7eth0\u63a5\u53e3\u4e0a\u7684\u6570\u636e\u5305\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5728packets.pcap\u6587\u4ef6\u4e2d\uff1a<\/p>\n
tcpdump -i eth0 -w packets.pcap<\/p><\/pre>\n
\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bfb\u53d6packets.pcap\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5305\uff1a<\/p>\n
tcpdump -r packets.pcap<\/p><\/pre>\n
\u4f7f\u7528wireshark\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305<\/h3>\n
\u4f7f\u7528wireshark\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165wireshark\u547d\u4ee4\u5373\u53ef\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528-i\u53c2\u6570\u6307\u5b9a\u63a5\u53e3\uff0c\u4f7f\u7528-r\u53c2\u6570\u6307\u5b9a\u8bfb\u53d6\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6355\u83b7eth0\u63a5\u53e3\u4e0a\u7684\u6570\u636e\u5305\uff1a<\/p>\n
wireshark -i eth0<\/p><\/pre>\n
\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bfb\u53d6packets.pcap\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5305\uff1a<\/p>\n
wireshark -r packets.pcap<\/p><\/pre>\n
\u5229\u7528\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u66f4\u597d\u5730\u7ba1\u7406\u7f51\u7edc<\/h2>\n
\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u4e0d\u4ec5\u53ef\u4ee5\u8ba9\u60a8\u4e86\u89e3\u7f51\u7edc\u72b6\u51b5\uff0c\u8fd8\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u7f51\u7edc\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u6765\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u6076\u610f\u8f6f\u4ef6\uff0c\u68c0\u6d4b\u7f51\u7edc\u4e2d\u7684\u653b\u51fb\u884c\u4e3a\uff0c\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u6027\u80fd\u95ee\u9898\uff0c\u4ee5\u53ca\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u5b89\u5168\u6f0f\u6d1e\u7b49\u3002<\/p>\n
\u603b\u7ed3<\/h2>\n
\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Linux\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u4ee5\u53ca\u5982\u4f55\u5229\u7528\u8fd9\u4e9b\u4fe1\u606f\u6765\u66f4\u597d\u5730\u7ba1\u7406\u7f51\u7edc\u3002<\/strong>Linux\u7cfb\u7edf\u4e2d\u6709\u8bb8\u591a\u5de5\u5177\u53ef\u4ee5\u7528\u6765\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662ftcpdump\u548cwireshark\u3002\u4f7f\u7528tcpdump\u548cwireshark\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u975e\u5e38\u7b80\u5355\uff0c\u60a8\u53ea\u9700\u8981\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u76f8\u5e94\u7684\u547d\u4ee4\u5373\u53ef\u3002\u6b64\u5916\uff0c\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u8fd8\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u7f51\u7edc\uff0c\u4f8b\u5982\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u6076\u610f\u8f6f\u4ef6\uff0c\u68c0\u6d4b\u7f51\u7edc\u4e2d\u7684\u653b\u51fb\u884c\u4e3a\uff0c\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u6027\u80fd\u95ee\u9898\uff0c\u4ee5\u53ca\u68c0\u6d4b\u7f51\u7edc\u4e2d\u662f\u5426\u5b58\u5728\u5b89\u5168\u6f0f\u6d1e\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u968f\u7740\u7f51\u7edc\u6280\u672f\u7684\u53d1\u5c55\uff0cLinux\u64cd\u4f5c\u7cfb\u7edf\u5df2\u7ecf\u6210\u4e3a\u5f53\u4eca\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u4e00\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5404\u79cd\u5de5\u5177\u6765\u67e5\u770b\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u4e86\u89e3\u7f51\u7edc\u72b6\u51b5\u3002\u672c\u6587\u5c06<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[305],"class_list":["post-39815","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-dzjs"],"_links":{"self":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts\/39815"}],"collection":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/comments?post=39815"}],"version-history":[{"count":0,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts\/39815\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/media?parent=39815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/categories?post=39815"},{"taxonomy":"post_tag","embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/tags?post=39815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}