{"id":161,"date":"2025-03-16T22:18:13","date_gmt":"2025-03-16T14:18:13","guid":{"rendered":"https:\/\/blog.unicom.cloudns.be\/?p=161"},"modified":"2025-03-17T15:19:22","modified_gmt":"2025-03-17T07:19:22","slug":"tcpdump%e7%ae%80%e6%98%8e%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/blog.unicom.cloudns.be\/?p=161","title":{"rendered":"tcpdump\u7b80\u660e\u4f7f\u7528\u8bf4\u660e"},"content":{"rendered":"<h1>\u4e00\u3001\u5e38\u7528\u53c2\u6570\u8bf4\u660e<\/h1>\n<p><code>-c<\/code>\uff1a\u6293\u5305\u6b21\u6570\uff0c\u8fbe\u5230\u81ea\u5b9a\u6b21\u6570\u540e\u505c\u6b62\u6293\u5305<br \/>\n<code>-C<\/code>\uff1a\u6587\u4ef6\u5927\u5c0f\uff0c\u5199\u5165\u6587\u4ef6\u524d\u5224\u65ad\u6587\u4ef6\u662f\u5426\u8d85\u8fc7\u4e86\u8bbe\u7f6e\u5927\u5c0f\uff0c\u8d85\u8fc7\u5219\u5173\u95ed\u5f53\u524d\u6587\u4ef6\uff0c\u5f00\u542f\u65b0\u6587\u4ef6<br \/>\n<code>-i<\/code>\uff1a\u6307\u5b9a\u76d1\u542c\u7684\u7f51\u7edc\u63a5\u53e3<br \/>\n<code>-nn<\/code>\uff1a\u4e0d\u8fdb\u884c\u7aef\u53e3\u540d\u79f0\u7684\u8f6c\u6362<br \/>\n<code>-r<\/code>\uff1a\u4ece\u6307\u5b9a\u6587\u4ef6\u4e2d\u8bfb\u53d6\u5305<br \/>\n<code>-s<\/code>\uff1a\u8bbe\u7f6e\u6bcf\u4e2a\u6570\u636e\u5305\u7684\u5927\u5c0f<br \/>\n<code>-t<\/code>\uff1a\u5728\u8f93\u51fa\u7684\u6bcf\u4e00\u884c\u4e0d\u6253\u5370\u65f6\u95f4\u6233<br \/>\n<code>-vv<\/code>\uff1a\u8f93\u51fa\u8be6\u7ec6\u7684\u62a5\u6587\u4fe1\u606f<br \/>\n<code>-w<\/code>\uff1a\u5c06\u6293\u5305\u7684\u7ed3\u679c\u8f93\u51fa\u5230\u6307\u5b9a\u6587\u4ef6  <\/p>\n<h1>\u4e8c\u3001\u652f\u6301\u7684\u8fc7\u6ee4\u65b9\u5f0f<\/h1>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\"><strong>\u8fc7\u6ee4\u9879<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>\u8fc7\u6ee4\u9879\u8bf4\u660e<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>\u793a\u4f8b<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">host\u3001src host\u3001dst host<\/td>\n<td style=\"text-align: center;\">\u8fc7\u6ee4\u4e3b\u673a<\/td>\n<td style=\"text-align: center;\"><code>tcpdump host 192.168.1.1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">port\u3001src port\u3001dst port<\/td>\n<td style=\"text-align: center;\">\u8fc7\u6ee4\u7aef\u53e3<\/td>\n<td style=\"text-align: center;\"><code>tcpdump port 443<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">ip\u3001ip6\u3001arp\u3001tcp\u3001udp\u3001icmp<\/td>\n<td style=\"text-align: center;\">\u8fc7\u6ee4\u534f\u8bae<\/td>\n<td style=\"text-align: center;\"><code>tcpdump udp 192.168.1.1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">and\u3001or\u3001not<\/td>\n<td style=\"text-align: center;\">\u903b\u8f91\u8868\u8fbe\u5f0f<\/td>\n<td style=\"text-align: center;\"><code>tcpdump host 192.168.1.1 and port 443<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u4e09\u3001\u793a\u4f8b<\/h1>\n<ol>\n<li>\u4ece\u6240\u6709\u7f51\u5361\u6293\u53d6\u6570\u636e\u5305<br \/>\n<code>tcpdump -i any<\/code>  <\/li>\n<li>\u4ece\u6307\u5b9a\u7f51\u5361\u6293\u53d6\u6570\u636e\u5305<br \/>\n<code>tcpdump -i eth0<\/code>  <\/li>\n<li>\u6293\u53d6\u5305\u542b\u6307\u5b9aIP\u7684\u6570\u636e\u5305<br \/>\n<code>tcpdump host 192.168.1.1<\/code>  <\/li>\n<li>\u83b7\u53d6\u6307\u5b9a\u7f51\u5361\u548c\u5730\u5740\u7684\u6570\u636e\u5305\uff0c\u5e76\u5199\u5165\u6587\u4ef6<br \/>\n<code>tcpdump -i eth0 host 192.168.1.1 -w capture.cap<\/code>  <\/li>\n<li>\u6307\u5b9a\u7f51\u5361\u3001\u6e90IP\u3001\u76ee\u7684IP\u5e76\u5199\u5165\u6587\u4ef6<br \/>\n<code>tcpdump -eth0 src host 192.168.1.1 and dst host 192.158.1.2 -w capture.cap<\/code>  <\/li>\n<li>\u6307\u5b9a\u7f51\u5361\u3001\u6e90IP\u6216\u76ee\u7684IP\u5e76\u5199\u5165\u6587\u4ef6<br \/>\n<code>tcpdump -i eth0 src host 192.168.1.1 or dst host 192.168.1.2 -w capture.cap<\/code>  <\/li>\n<li>\u6307\u5b9a\u7f51\u5361\u3001tcp\u7aef\u53e3\u3001\u6e90IP\u3001\u76ee\u7684IP<br \/>\n<code>tcpdump -i eth0 port 443 and src host 192.168.1.1 and dst host 192.168.1.2<\/code>  <\/li>\n<li>\u663e\u793a\u8be6\u7ec6\u7684\u6293\u5305\u4fe1\u606f<br \/>\n<code>tcpdump -vv<\/code>  <\/li>\n<li>\u6293\u53d6UDP\u5305<br \/>\n<code>tcpdump -i eth0 udp port 443<\/code>  <\/li>\n<\/ol>\n<h1>\u53c2\u8003\u8d44\u6599<\/h1>\n<blockquote>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/qq_41943900\/article\/details\/128035119\">https:\/\/blog.csdn.net\/qq_41943900\/article\/details\/128035119<\/a><\/li>\n<\/ul>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5e38\u7528\u53c2\u6570\u8bf4\u660e -c\uff1a\u6293\u5305\u6b21\u6570\uff0c\u8fbe\u5230\u81ea\u5b9a\u6b21\u6570\u540e\u505c\u6b62\u6293\u5305 -C\uff1a\u6587\u4ef6\u5927\u5c0f\uff0c\u5199\u5165\u6587\u4ef6\u524d\u5224\u65ad\u6587\u4ef6\u662f\u5426\u8d85\u8fc7\u4e86\u8bbe\u7f6e\u5927\u5c0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-7"],"_links":{"self":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":2,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}