host<\/code>\u9009\u9879\u540e\u9762\u6dfb\u52a0ip \u6216\u8005\u4e3b\u673a\u540d\u6765\u6355\u83b7\u7279\u5b9a\u4e3b\u673a\u7684\u6570\u636e\u5305\u3002<\/p>\n\r\n[root@localhost ~]# tcpdump host redhat.com -i any -c5\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes\r\n20:27:19.762717 IP localhost.localdomain.59096 > redirect.redhat.com.https: Flags [S], seq 2565597156, win 29200, options [mss 1460,sackOK,TS val 178658343 ecr 0,nop,wscale 7], length 0\r\n20:27:19.977742 IP redirect.redhat.com.https > localhost.localdomain.59096: Flags [S.], seq 1933719472, ack 2565597157, win 64240, options [mss 1460], length 0\r\n20:27:19.977773 IP localhost.localdomain.59096 > redirect.redhat.com.https: Flags [.], ack 1, win 29200, length 0\r\n20:27:19.983584 IP localhost.localdomain.59096 > redirect.redhat.com.https: Flags [P.], seq 1:518, ack 1, win 29200, length 517\r\n20:27:19.983781 IP redirect.redhat.com.https > localhost.localdomain.59096: Flags [.], ack 518, win 64240, length 0\r\n5 packets captured\r\n9 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n
\n\u53ef\u4ee5\u4f7f\u7528 src \u6216 dst \u5173\u952e\u5b57\u544a\u8bc9 tcpdump \u6355\u83b7\u7684\u6570\u636e\u5305\u662f\u5426\u5e94\u5305\u542b\u6e90\u5730\u5740\u6216\u76ee\u6807\u5730\u5740\u4e2d\u7684\u4e3b\u673a\u3002\u5217\u5165\u4e0b\u9762\u83b7\u53d6\u6e90\u4e3b\u673a\u5730\u5740\u4e3aredhat.com\u7684\u6570\u636e\u5305\uff0c\u548c\u83b7\u53d6\u76ee\u7684\u4e3b\u673a\u5730\u5740\u4e3aredhat.com\u7684\u6570\u636e\u5305\uff1a<\/p>\n
\r\n[root@localhost ~]# tcpdump src host redhat.com -i any -c5\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes\r\n20:29:23.090360 IP redirect.redhat.com.https > localhost.localdomain.59098: Flags [S.], seq 1420240111, ack 1139421965, win 64240, options [mss 1460], length 0\r\n20:29:23.096748 IP redirect.redhat.com.https > localhost.localdomain.59098: Flags [.], ack 518, win 64240, length 0\r\n20:29:23.353159 IP redirect.redhat.com.https > localhost.localdomain.59098: Flags [P.], seq 1:1381, ack 518, win 64240, length 1380\r\n20:29:23.353434 IP redirect.redhat.com.https > localhost.localdomain.59098: Flags [.], seq 1381:2841, ack 518, win 64240, length 1460\r\n20:29:23.353461 IP redirect.redhat.com.https > localhost.localdomain.59098: Flags [P.], seq 2841:3407, ack 518, win 64240, length 566\r\n5 packets captured\r\n9 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n<\/p>\n
\r\n[root@localhost ~]# tcpdump dst host redhat.com -i any -c5\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes\r\n20:29:35.661917 IP localhost.localdomain.59100 > redirect.redhat.com.https: Flags [S], seq 4207740141, win 29200, options [mss 1460,sackOK,TS val 178783790 ecr 0,nop,wscale 7], length 0\r\n20:29:35.886845 IP localhost.localdomain.59100 > redirect.redhat.com.https: Flags [.], ack 1287594187, win 29200, length 0\r\n20:29:35.892463 IP localhost.localdomain.59100 > redirect.redhat.com.https: Flags [P.], seq 0:517, ack 1, win 29200, length 517\r\n20:29:36.121990 IP localhost.localdomain.59100 > redirect.redhat.com.https: Flags [.], ack 1461, win 32120, length 0\r\n20:29:36.122028 IP localhost.localdomain.59100 > redirect.redhat.com.https: Flags [.], ack 2921, win 35040, length 0\r\n5 packets captured\r\n10 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n<\/p>\n
\u903b\u8f91\u8fd0\u7b97\u7b26<\/strong><\/div>\ntcpdump \u652f\u6301and\/or\/not<\/code>\u8fd0\u7b97\u7b26\u4f5c\u4e3a\u5173\u952e\u5b57\uff0c\u4f8b\u5982\uff0ctcpdump -i ens33 \u201chost gulass.cn and (port 80 or port 443)\u201d<\/code>\u3002\u5728\u590d\u5408\u8868\u8fbe\u5f0f\u5468\u56f4\u4f7f\u7528\u5f15\u53f7\u662f\u5f88\u6709\u5fc5\u8981\u7684\uff0c\u8fd9\u6837 bash shell\u5c31\u4e0d\u4f1a\u8bd5\u56fe\u89e3\u91ca\u62ec\u53f7\u3002<\/p>\n\r\n[root@localhost ~]# tcpdump -i any \"host gulass.cn and (port 80 or port 443)\" -s64 -c5\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 64 bytes\r\n20:37:12.398299 IP localhost.localdomain.52754 > 140.249.61.18.https: Flags [S], seq 3304304157, win 29200, options [mss 1460,sackOK,TS[|tcp]>\r\n20:37:12.408805 IP 140.249.61.18.https > localhost.localdomain.52754: Flags [S.], seq 2112965730, ack 3304304158, win 64240, options [mss 1460], length 0\r\n20:37:12.408842 IP localhost.localdomain.52754 > 140.249.61.18.https: Flags [.], ack 1, win 29200, length 0\r\n20:37:12.414672 IP localhost.localdomain.52754 > 140.249.61.18.https: Flags [P.], seq 1:518, ack 1, win 29200, length 517\r\n20:37:12.414948 IP 140.249.61.18.https > localhost.localdomain.52754: Flags [.], ack 518, win 64240, length 0\r\n5 packets captured\r\n9 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n<\/p>\n
net \u5173\u952e\u5b57<\/strong><\/div>\nnet<\/code> \u5173\u952e\u5b57\u53ef\u7528\u4e8e\u6355\u83b7\u4e00\u4e2a\u7f51\u6bb5\u7684\u6570\u636e\u5305\u3002net\u5173\u952e\u5b57\u8fd8\u53ef\u4ee5\u5c06 src \u548c ds\u4e0e\u903b\u8f91\u8fd0\u7b97\u7b26\u4e00\u8d77\u4f7f\u7528\uff0c\u5e76\u66f4\u7cbe\u786e\u5730\u8fc7\u6ee4\u5305\u3002\u4e0b\u9762\u5b9e\u4f8b\u662f\u83b7\u53d6\u6e90net\u4e3a192.168.0.0\/16\u7f51\u6bb5\uff0c\u5e76\u4e14\u76ee\u6807net\u4e0d\u5305\u542b192.168.0.0\/16\u7f51\u6bb5\u7684\u6570\u636e\u5305\u3002<\/p>\n\r\n[root@localhost ~]# tcpdump -i any -n \"src net 192.168.0.0\/16 and not dst net 192.168.0.0\/16\" -c4\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes\r\n20:43:25.558537 IP 192.168.43.131.34562 > 140.249.61.18.http: Flags [S], seq 3720011773, win 29200, options [mss 1460,sackOK,TS val 4199917698 ecr 0,nop,wscale 7], length 0\r\n20:43:25.571477 IP 192.168.43.131.34562 > 140.249.61.18.http: Flags [.], ack 1199844, win 29200, length 0\r\n20:43:25.571693 IP 192.168.43.131.34562 > 140.249.61.18.http: Flags [P.], seq 0:82, ack 1, win 29200, length 82: HTTP: GET \/ HTTP\/1.1\r\n20:43:25.587514 IP 192.168.43.131.34562 > 140.249.61.18.http: Flags [.], ack 546, win 29975, length 0\r\n4 packets captured\r\n4 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n<\/p>\n
ip6 \u5173\u952e\u5b57<\/strong><\/div>\n\u53ef\u4ee5\u4f7f\u7528 ip6<\/code> \u5173\u952e\u5b57\u6355\u83b7 IPv6 \u6d41\u91cf\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n\r\n[root@localhost ~]# tcpdump -i any ip6 host fe80::9520:7b41:7099:c6f7 -c4\r\ndropped privs to tcpdump\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes\r\n22:17:08.182720 IP6 localhost.localdomain > fe80::9520:7b41:7099:c6f7: ICMP6, echo request, seq 12, length 64\r\n22:17:08.183329 IP6 fe80::9520:7b41:7099:c6f7 > localhost.localdomain: ICMP6, echo reply, seq 12, length 64\r\n22:17:09.207102 IP6 localhost.localdomain > fe80::9520:7b41:7099:c6f7: ICMP6, echo request, seq 13, length 64\r\n22:17:09.207555 IP6 fe80::9520:7b41:7099:c6f7 > localhost.localdomain: ICMP6, echo reply, seq 13, length 64\r\n4 packets captured\r\n4 packets received by filter\r\n0 packets dropped by kernel\r\n<\/pre>\n<\/p>\n
\u603b\u7ed3<\/strong><\/div>\ntcpdump \u7528\u4e8e\u6536\u96c6\u6709\u5173\u7f51\u7edc\u6d41\u91cf\u6570\u636e\u7684\u51fa\u8272\u5de5\u5177\u3002\u6570\u636e\u5305\u6355\u83b7\u4e3a\u6545\u969c\u6392\u9664\u548c\u5b89\u5168\u5206\u6790\u63d0\u4f9b\u4e86\u6709\u7528\u7684\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5982\u679c\u4f60\u5bfc\u51fa\u4e86\u4e00\u4e2a .pcap \u6587\u4ef6\uff0c\u4f60\u5c31\u4f1a\u77e5\u9053\u4e0d\u80fd\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6765\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u3002\u56e0\u6b64\uff0c\u4f60\u5e94\u8be5\u4f7f\u7528-r file […]<\/p>\n","protected":false},"author":309,"featured_media":223707,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-223706","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/223706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=223706"}],"version-history":[{"count":3,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/223706\/revisions"}],"predecessor-version":[{"id":230371,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/223706\/revisions\/230371"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/223707"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=223706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=223706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=223706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}