{"id":5425,"date":"2019-11-21T22:26:27","date_gmt":"2019-11-21T14:26:27","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5425"},"modified":"2022-05-26T12:16:45","modified_gmt":"2022-05-26T04:16:45","slug":"tcpdump","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/tcpdump","title":{"rendered":"tcpdump\u547d\u4ee4 – \u76d1\u542c\u7f51\u7edc\u6d41\u91cf"},"content":{"rendered":"\n

tcpdump\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u76d1\u542c\u7f51\u7edc\u6d41\u91cf\uff0c\u662f\u4e00\u6b3e\u6570\u636e\u55c5\u63a2\u5de5\u5177\uff0cLinux\u7cfb\u7edf\u4e2d\u5e38\u7528\u7684\u6570\u636e\u6293\u5305\u8f6f\u4ef6\uff0c\u80fd\u591f\u8bb0\u5f55\u6240\u6709\u7ecf\u8fc7\u670d\u52a1\u5668\u7684\u6570\u636e\u5305\u4fe1\u606f\uff0c\u9700\u8981\u4f7f\u7528\u7ba1\u7406\u5458\u8eab\u4efd\u6267\u884c\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f:<\/strong> tcpdump [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong> <\/p>\n\n\n\n

-a<\/td>\u5c1d\u8bd5\u5c06\u7f51\u7edc\u548c\u5e7f\u64ad\u5730\u5740\u8f6c\u6362\u6210\u540d\u79f0<\/td><\/tr>
-c<\u6570\u636e\u5305\u6570\u76ee><\/td>\u6536\u5230\u6307\u5b9a\u7684\u6570\u636e\u5305\u6570\u76ee\u540e\uff0c\u5c31\u505c\u6b62\u8fdb\u884c\u503e\u5012\u64cd\u4f5c<\/td><\/tr>
-d<\/td>\u628a\u7f16\u8bd1\u8fc7\u7684\u6570\u636e\u5305\u7f16\u7801\u8f6c\u6362\u6210\u53ef\u9605\u8bfb\u7684\u683c\u5f0f<\/td><\/tr>
-dd<\/td>\u628a\u7f16\u8bd1\u8fc7\u7684\u6570\u636e\u5305\u7f16\u7801\u8f6c\u6362\u6210C\u8bed\u8a00\u7684\u683c\u5f0f<\/td><\/tr>
-ddd<\/td>\u628a\u7f16\u8bd1\u8fc7\u7684\u6570\u636e\u5305\u7f16\u7801\u8f6c\u6362\u6210\u5341\u8fdb\u5236\u6570\u5b57\u7684\u683c\u5f0f<\/td><\/tr>
-e<\/td>\u5728\u6bcf\u5217\u503e\u5012\u8d44\u6599\u4e0a\u663e\u793a\u8fde\u63a5\u5c42\u7ea7\u7684\u6587\u4ef6\u5934<\/td><\/tr>
-f<\/td>\u7528\u6570\u5b57\u663e\u793a\u7f51\u9645\u7f51\u7edc\u5730\u5740<\/td><\/tr>
-F<\u8868\u8fbe\u6587\u4ef6><\/td>\u6307\u5b9a\u5185\u542b\u8868\u8fbe\u65b9\u5f0f\u7684\u6587\u4ef6<\/td><\/tr>
-i<\u7f51\u7edc\u754c\u9762><\/td>\u4f7f\u7528\u6307\u5b9a\u7684\u7f51\u7edc\u622a\u9762\u9001\u51fa\u6570\u636e\u5305<\/td><\/tr>
-l<\/td>\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u5217\u7684\u7f13\u51b2\u533a<\/td><\/tr>
-n<\/td>\u4e0d\u628a\u4e3b\u673a\u7684\u7f51\u7edc\u5730\u5740\u8f6c\u6362\u6210\u540d\u5b57<\/td><\/tr>
-N<\/td>\u4e0d\u5217\u51fa\u57df\u540d<\/td><\/tr>
-O<\/td>\u4e0d\u5c06\u6570\u636e\u5305\u7f16\u7801\u6700\u4f73\u5316<\/td><\/tr>
-p<\/td>\u4e0d\u8ba9\u7f51\u7edc\u754c\u9762\u8fdb\u5165\u6df7\u6742\u6a21\u5f0f<\/td><\/tr>
-q<\/td>\u5feb\u901f\u8f93\u51fa\uff0c\u4ec5\u5217\u51fa\u5c11\u6570\u7684\u4f20\u8f93\u534f\u8bae\u4fe1\u606f<\/td><\/tr>
-r<\u6570\u636e\u5305\u6587\u4ef6><\/td>\u4ece\u6307\u5b9a\u7684\u6587\u4ef6\u8bfb\u53d6\u6570\u636e\u5305\u6570\u636e<\/td><\/tr>
-s<\u6570\u636e\u5305\u5927\u5c0f><\/td>\u8bbe\u7f6e\u6bcf\u4e2a\u6570\u636e\u5305\u7684\u5927\u5c0f<\/td><\/tr>
-S<\/td>\u7528\u7edd\u5bf9\u800c\u975e\u76f8\u5bf9\u6570\u503c\u5217\u51faTCP\u5173\u8054\u6570<\/td><\/tr>
-t<\/td>\u5728\u6bcf\u5217\u503e\u5012\u8d44\u6599\u4e0a\u4e0d\u663e\u793a\u65f6\u95f4\u6233\u8bb0<\/td><\/tr>
-tt<\/td>\u5728\u6bcf\u5217\u503e\u5012\u8d44\u6599\u4e0a\u663e\u793a\u672a\u7ecf\u683c\u5f0f\u5316\u7684\u65f6\u95f4\u6233\u8bb0<\/td><\/tr>
-T<\u6570\u636e\u5305\u7c7b\u578b><\/td>\u5f3a\u5236\u5c06\u8868\u8fbe\u65b9\u5f0f\u6240\u6307\u5b9a\u7684\u6570\u636e\u5305\u8f6c\u8bd1\u6210\u8bbe\u7f6e\u7684\u6570\u636e\u5305\u7c7b\u578b<\/td><\/tr>
-v<\/td>\u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b<\/td><\/tr>
-vv<\/td>\u66f4\u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b<\/td><\/tr>
-x<\/td>\u7528\u5341\u516d\u8fdb\u5236\u5b57\u7801\u5217\u51fa\u6570\u636e\u5305\u8d44\u6599<\/td><\/tr>
-w<\u6570\u636e\u5305\u6587\u4ef6><\/td>\u628a\u6570\u636e\u5305\u6570\u636e\u5199\u5165\u6307\u5b9a\u7684\u6587\u4ef6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u76d1\u89c6\u6307\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u6570\u636e\u5305\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# tcpdump -i ens160<\/strong><\/pre>\n\n\n\n

\u76d1\u89c6\u6307\u5b9a\u4e3b\u673a\u7684\u6570\u636e\u5305\uff08\u4e3b\u673a\u540d\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# tcpdump host linuxcool.com<\/strong><\/pre>\n\n\n\n

\u76d1\u542c\u6307\u5b9a\u4e3b\u673a\u7684\u6570\u636e\u5305\uff08IP\u5730\u5740\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# tcpdump host 192.168.10.10<\/strong><\/pre>\n\n\n\n

\u76d1\u542c\u6307\u5b9a\u7aef\u53e3\u53f7\u7684\u6570\u636e\u5305\uff0c\u5e76\u4ee5\u6587\u672c\u5f62\u5f0f\u5c55\u793a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# tcpdump -i any port 80 -A<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

tcpdump\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u76d1\u542c\u7f51\u7edc\u6d41\u91cf\uff0c\u662f\u4e00\u6b3e\u6570\u636e\u55c5\u63a2\u5de5\u5177\uff0cLinux\u7cfb\u7edf\u4e2d\u5e38\u7528\u7684\u6570\u636e\u6293\u5305\u8f6f\u4ef6\uff0c\u80fd\u591f\u8bb0\u5f55\u6240 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5425"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=5425"}],"version-history":[{"count":11,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5425\/revisions"}],"predecessor-version":[{"id":10052,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5425\/revisions\/10052"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}