tcpdump 是一款强大的网络抓包工具,它使用 libpcap 库来抓取网络数据包,这个库在几乎在所有的 linux/unix 中都有。熟悉 tcpdump 的使用能够帮助你分析调试网络数据,本文将通过一个个具体的示例来介绍它在不同场景下的使用方法。不管你是系统管理员,程序员,云原生工程师还是 yaml 工程师,掌握 tcpdump 的使用都能让你如虎添翼,升职加薪。
1. 基本语法和使用方法 tcpdump 的常用参数如下:
$ tcpdump -i eth0 -nn -s0 -v port 80 -i : 选择要捕获的接口,通常是以太网卡或无线网卡,也可以是 vlan 或其他特殊接口。如果该系统上只有一个网络接口,则无需指定。 -nn : 单个 n 表示不解析域名,直接显示 ip;两个 n 表示不解析域名和端口。这样不仅方便查看 ip 和端口号,而且在抓取大量数据时非常高效,因为域名解析会降低抓取速度。 -s0 : tcpdump 默认只会截取前 96 字节的内容,要想截取所有的报文内容,可以使用 -s number, number 就是你要截取的报文字节数,如果是 0 的话,表示截取报文全部内容。 -v : 使用 -v,-vv 和 -vvv 来显示更多的详细信息,通常会显示更多与特定协议相关的信息。 port 80 : 这是一个常见的端口过滤器,表示仅抓取 80 端口上的流量,通常是 http。 额外再介绍几个常用参数:
-p : 不让网络接口进入混杂模式。默认情况下使用 tcpdump 抓包时,会让网络接口进入混杂模式。一般计算机网卡都工作在非混杂模式下,此时网卡只接受来自网络端口的目的地址指向自己的数据。当网卡工作在混杂模式下时,网卡将来自接口的所有数据都捕获并交给相应的驱动程序。如果设备接入的交换机开启了混杂模式,使用 -p 选项可以有效地过滤噪声。 -e : 显示数据链路层信息。默认情况下 tcpdump 不会显示数据链路层信息,使用 -e 选项可以显示源和目的 mac 地址,以及 vlan tag 信息。例如: $ tcpdump -n -e -c 5 not ip6tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on br-lan, link-type en10mb (ethernet), capture size 262144 bytes18:27:53.619865 24:5e0c:17:af > 0069:233b, ethertype ipv4 (0x0800), length 1162: 192.168.100.20.51410 > 180.176.26.193.58695: flags [.], seq 2045333376:2045334484, ack 3398690514, win 751, length 110818:27:53.626490 0069:233b > 24:5e0c:17:af, ethertype ipv4 (0x0800), length 68: 220.173.179.66.36017 > 192.168.100.20.51410: udp, length 2618:27:53.626893 24:5e0c:17:af > 0069:233b, ethertype ipv4 (0x0800), length 1444: 192.168.100.20.51410 > 220.173.179.66.36017: udp, length 140218:27:53.628837 0069:233b > 24:5e0c:17:af, ethertype ipv4 (0x0800), length 1324: 46.97.169.182.6881 > 192.168.100.20.59145: flags [p.], seq 3058450381:3058451651, ack 14349180, win 502, length 127018:27:53.629096 24:5e0c:17:af > 0069:233b, ethertype ipv4 (0x0800), length 54: 192.168.100.20.59145 > 192.168.100.1.12345: flags [.], ack 3058451651, win 6350, length 05 packets captured 显示 ascii 字符串 -a 表示使用 ascii 字符串打印报文的全部数据,这样可以使读取更加简单,方便使用 grep 等工具解析输出内容。-x 表示同时使用十六进制和 ascii 字符串打印报文的全部数据。这两个参数不能一起使用。例如:
$ tcpdump -a -s0 port 80 抓取特定协议的数据 后面可以跟上协议名称来过滤特定协议的流量,以 udp 为例,可以加上参数 udp 或 protocol 17,这两个命令意思相同。
$ tcpdump -i eth0 udp$ tcpdump -i eth0 proto 17 同理,tcp 与 protocol 6 意思相同。
抓取特定主机的数据 使用过滤器 host 可以抓取特定目的地和源 ip 地址的流量。
$ tcpdump -i eth0 host 10.10.1.1 也可以使用 src 或 dst 只抓取源或目的地:
$ tcpdump -i eth0 dst 10.10.1.20 将抓取的数据写入文件 使用 tcpdump 截取数据报文的时候,默认会打印到屏幕的默认输出,你会看到按照顺序和格式,很多的数据一行行快速闪过,根本来不及看清楚所有的内容。不过,tcpdump 提供了把截取的数据保存到文件的功能,以便后面使用其他图形工具(比如 wireshark,snort)来分析。
-w 选项用来把数据报文输出到文件:
$ tcpdump -i eth0 -s0 -w test.pcap 行缓冲模式 如果想实时将抓取到的数据通过管道传递给其他工具来处理,需要使用 -l 选项来开启行缓冲模式(或使用 -c 选项来开启数据包缓冲模式)。使用 -l 选项可以将输出通过立即发送给其他命令,其他命令会立即响应。
$ tcpdump -i eth0 -s0 -l port 80 | grep 'server:' 组合过滤器 过滤的真正强大之处在于你可以随意组合它们,而连接它们的逻辑就是常用的 与/and/&& 、 或/or/|| 和 非/not/!。
and or &&or or ||not or ! 2. 过滤器 关于 tcpdump 的过滤器,这里有必要单独介绍一下。
机器上的网络报文数量异常的多,很多时候我们只关系和具体问题有关的数据报(比如访问某个网站的数据,或者 icmp 超时的报文等等),而这些数据只占到很小的一部分。把所有的数据截取下来,从里面找到想要的信息无疑是一件很费时费力的工作。而 tcpdump 提供了灵活的语法可以精确地截取关心的数据报,简化分析的工作量。这些选择数据包的语句就是过滤器(filter)!
host 过滤器 host 过滤器用来过滤某个主机的数据报文。例如:
$ tcpdump host 1.2.3.4 该命令会抓取所有发往主机 1.2.3.4 或者从主机 1.2.3.4 发出的流量。如果想只抓取从该主机发出的流量,可以使用下面的命令:
$ tcpdump src host 1.2.3.4 network 过滤器 network 过滤器用来过滤某个网段的数据,使用的是 cidr 模式。可以使用四元组(x.x.x.x)、三元组(x.x.x)、二元组(x.x)和一元组(x)。四元组就是指定某个主机,三元组表示子网掩码为 255.255.255.0,二元组表示子网掩码为 255.255.0.0,一元组表示子网掩码为 255.0.0.0。例如,
抓取所有发往网段 192.168.1.x 或从网段 192.168.1.x 发出的流量:
$ tcpdump net 192.168.1 抓取所有发往网段 10.x.x.x 或从网段 10.x.x.x 发出的流量:
$ tcpdump net 10 和 host 过滤器一样,这里也可以指定源和目的:
$ tcpdump src net 10 也可以使用 cidr 格式:
$ tcpdump src net 172.16.0.0/12 proto 过滤器 proto 过滤器用来过滤某个协议的数据,关键字为 proto,可省略。proto 后面可以跟上协议号或协议名称,支持 icmp, igmp, igrp, pim, ah, esp, carp, vrrp, udp和 tcp。因为通常的协议名称是保留字段,所以在于 proto 指令一起使用时,必须根据 shell 类型使用一个或两个反斜杠(/)来转义。linux 中的 shell 需要使用两个反斜杠来转义,macos 只需要一个。
例如,抓取 icmp 协议的报文:
$ tcpdump -n proto \icmp# 或者$ tcpdump -n icmp port 过滤器 port 过滤器用来过滤通过某个端口的数据报文,关键字为 port。例如:
$ tcpdump port 389 3. 理解 tcpdump 的输出 截取数据只是第一步,第二步就是理解这些数据,下面就解释一下 tcpdump 命令输出各部分的意义。
2106.995846 ip (tos 0x0, ttl 64, id 45646, offset 0, flags [df], proto tcp (6), length 64) 192.168.1.106.56166 > 124.192.132.54.80: flags [s], cksum 0xa730 (correct), seq 992042666, win 65535, options [mss 1460,nop,wscale 4,nop,nop,ts val 663433143 ecr 0,sackok,eol], length 02107.030487 ip (tos 0x0, ttl 51, id 0, offset 0, flags [df], proto tcp (6), length 44) 124.192.132.54.80 > 192.168.1.106.56166: flags [s.], cksum 0xedc0 (correct), seq 2147006684, ack 992042667, win 14600, options [mss 1440], length 02107.030527 ip (tos 0x0, ttl 64, id 59119, offset 0, flags [df], proto tcp (6), length 40) 192.168.1.106.56166 > 124.192.132.54.80: flags [.], cksum 0x3e72 (correct), ack 2147006685, win 65535, length 0 最基本也是最重要的信息就是数据报的源地址/端口和目的地址/端口,上面的例子第一条数据报中,源地址 ip 是 192.168.1.106,源端口是 56166,目的地址是 124.192.132.54,目的端口是 80。 > 符号代表数据的方向。
此外,上面的三条数据还是 tcp 协议的三次握手过程,第一条就是 syn 报文,这个可以通过 flags [s] 看出。下面是常见的 tcp 报文的 flags:
[s] : syn(开始连接) [.] : 没有 flag [p] : psh(推送数据) [f] : fin (结束连接) [r] : rst(重置连接) 而第二条数据的 [s.] 表示 syn-ack,就是 syn 报文的应答报文。
4. 例子 下面给出一些具体的例子,每个例子都可以使用多种方法来获得相同的输出,你使用的方法取决于所需的输出和网络上的流量。我们在排障时,通常只想获取自己想要的内容,可以通过过滤器和 ascii 输出并结合管道与 grep、cut、awk 等工具来实现此目的。
例如,在抓取 http 请求和响应数据包时,可以通过删除标志 syn/ack/fin 来过滤噪声,但还有更简单的方法,那就是通过管道传递给 grep。在达到目的的同时,我们要选择最简单最高效的方法。下面来看例子。
提取 http 用户代理 从 http 请求头中提取 http 用户代理:
$ tcpdump -nn -a -s1500 -l | grep user-agent: 通过 egrep 可以同时提取用户代理和主机名(或其他头文件):
$ tcpdump -nn -a -s1500 -l | egrep -i 'user-agent:|host:' 只抓取 http get 和 post 流量 抓取 http get 流量:
$ tcpdump -s 0 -a -vv 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' 也可以抓取 http post 请求流量:
$ tcpdump -s 0 -a -vv 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354' 注意:该方法不能保证抓取到 http post 有效数据流量,因为一个 post 请求会被分割为多个 tcp 数据包。
上述两个表达式中的十六进制将会与 get 和 post 请求的 ascii 字符串匹配。例如,tcp[((tcp[12:1] & 0xf0) >> 2):4] 首先会确定我们感兴趣的字节的位置(在 tcp header 之后),然后选择我们希望匹配的 4 个字节。
提取 http 请求的 url 提取 http 请求的主机名和路径:
$ tcpdump -s 0 -v -n -l | egrep -i post /|get /|host:tcpdump: listening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes post /wp-login.php http/1.1 host: dev.example.com get /wp-login.php http/1.1 host: dev.example.com get /favicon.ico http/1.1 host: dev.example.com get / http/1.1 host: dev.example.com 提取 http post 请求中的密码 从 http post 请求中提取密码和主机名:
$ tcpdump -s 0 -a -n -l | egrep -i post /|pwd=|passwd=|password=|host:tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes11:25:54.799014 ip 10.10.1.30.39224 > 10.10.1.125.80: flags [p.], seq 1458768667:1458770008, ack 2440130792, win 704, options [nop,nop,ts val 461552632 ecr 208900561], length 1341: http: post /wp-login.php http/1.1.....s..post /wp-login.php http/1.1host: dev.example.com.....s..log=admin&pwd=notmypassword&wp-submit=log+in&redirect_to=http%3a%2f%2fdev.example.com%2fwp-admin%2f&testcookie=1 提取 cookies 提取 set-cookie(服务端的 cookie)和 cookie(客户端的 cookie):
$ tcpdump -nn -a -s0 -l | egrep -i 'set-cookie|host:|cookie:'tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on wlp58s0, link-type en10mb (ethernet), capture size 262144 byteshost: dev.example.comcookie: wordpress_86be02xxxxxxxxxxxxxxxxxxxc43=admin%7c152xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb3e15c744fdd6; _ga=ga1.2.21343434343421934; _gid=ga1.2.927343434349426; wordpress_test_cookie=wp+cookie+check; wordpress_logged_in_86be654654645645645654645653fc43=admin%7c15275102testtesttesttestab7a61e; wp-settings-time-1=1527337439 抓取 icmp 数据包 查看网络上的所有 icmp 数据包:
$ tcpdump -n icmptcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes1121.590380 ip 10.10.1.217 > 10.10.1.30: icmp echo request, id 27948, seq 1, length 641121.590434 ip 10.10.1.30 > 10.10.1.217: icmp echo reply, id 27948, seq 1, length 641127.680307 ip 10.10.1.159 > 10.10.1.1: icmp 10.10.1.189 udp port 59619 unreachable, length 115 抓取非 echo/reply 类型的 icmp 数据包 通过排除 echo 和 reply 类型的数据包使抓取到的数据包不包括标准的 ping 包:
$ tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes11:37:04.041037 ip 10.10.1.189 > 10.10.1.20: icmp 10.10.1.189 udp port 36078 unreachable, length 156 抓取 smtp/pop3 协议的邮件 可以提取电子邮件的正文和其他数据。例如,只提取电子邮件的收件人:
$ tcpdump -nn -l port 25 | grep -i 'mail from|rcpt to' 抓取 ntp 服务的查询和响应 $ tcpdump dst port 123tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on eth0, link-type en10mb (ethernet), capture size 65535 bytes21:02:19.112502 ip test33.ntp > 199.30.140.74.ntp: ntpv4, client, length 4821:02:19.113888 ip 216.239.35.0.ntp > test33.ntp: ntpv4, server, length 4821:02:20.150347 ip test33.ntp > 216.239.35.0.ntp: ntpv4, client, length 4821:02:20.150991 ip 216.239.35.0.ntp > test33.ntp: ntpv4, server, length 48 抓取 snmp 服务的查询和响应 通过 snmp 服务,渗透测试人员可以获取大量的设备和系统信息。在这些信息中,系统信息最为关键,如操作系统版本、内核版本等。使用 snmp 协议快速扫描程序 onesixtyone,可以看到目标系统的信息:
$ onesixtyone 10.10.1.10 publicscanning 1 hosts, 1 communities10.10.1.10 [public] linux test33 4.15.0-20-generic #21-ubuntu smp tue apr 24 0615 utc 2018 x86_64 可以通过 tcpdump 抓取 getrequest 和 getresponse:
$ tcpdump -n -s0 port 161 and udptcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on wlp58s0, link-type en10mb (ethernet), capture size 262144 bytes2313.725522 ip 10.10.1.159.36826 > 10.10.1.20.161: getrequest(28) .1.3.6.1.2.1.1.1.02313.728789 ip 10.10.1.20.161 > 10.10.1.159.36826: getresponse(109) .1.3.6.1.2.1.1.1.0=linux testmachine 4.15.0-20-generic #21-ubuntu smp tue apr 24 0615 utc 2018 x86_64 切割 pcap 文件 当抓取大量数据并写入文件时,可以自动切割为多个大小相同的文件。例如,下面的命令表示每 3600 秒创建一个新文件 capture-(hour).pcap,每个文件大小不超过 200*1000000 字节:
$ tcpdump -w /tmp/capture-%h.pcap -g 3600 -c 200 这些文件的命名为 capture-{1-24}.pcap,24 小时之后,之前的文件就会被覆盖。
抓取 ipv6 流量 可以通过过滤器 ip6 来抓取 ipv6 流量,同时可以指定协议如 tcp:
$ tcpdump -nn ip6 proto 6 从之前保存的文件中读取 ipv6 udp 数据报文:
$ tcpdump -nr ipv6-test.pcap ip6 proto 17 检测端口扫描 在下面的例子中,你会发现抓取到的报文的源和目的一直不变,且带有标志位 [s] 和 [r],它们与一系列看似随机的目标端口进行匹配。当发送 syn 之后,如果目标主机的端口没有打开,就会返回一个 reset。这是 nmap 等端口扫描工具的标准做法。
$ tcpdump -nn2119.693601 ip 10.10.1.10.60460 > 10.10.1.199.5432: flags [s], seq 116466344, win 29200, options [mss 1460,sackok,ts val 3547090332 ecr 0,nop,wscale 7], length 02119.693626 ip 10.10.1.10.35470 > 10.10.1.199.513: flags [s], seq 3400074709, win 29200, options [mss 1460,sackok,ts val 3547090332 ecr 0,nop,wscale 7], length 02119.693762 ip 10.10.1.10.44244 > 10.10.1.199.389: flags [s], seq 2214070267, win 29200, options [mss 1460,sackok,ts val 3547090333 ecr 0,nop,wscale 7], length 02119.693772 ip 10.10.1.199.389 > 10.10.1.10.44244: flags [r.], seq 0, ack 2214070268, win 0, length 02119.693783 ip 10.10.1.10.35172 > 10.10.1.199.1433: flags [s], seq 2358257571, win 29200, options [mss 1460,sackok,ts val 3547090333 ecr 0,nop,wscale 7], length 02119.693826 ip 10.10.1.10.33022 > 10.10.1.199.49153: flags [s], seq 2406028551, win 29200, options [mss 1460,sackok,ts val 3547090333 ecr 0,nop,wscale 7], length 02119.695567 ip 10.10.1.10.55130 > 10.10.1.199.49154: flags [s], seq 3230403372, win 29200, options [mss 1460,sackok,ts val 3547090334 ecr 0,nop,wscale 7], length 02119.695590 ip 10.10.1.199.49154 > 10.10.1.10.55130: flags [r.], seq 0, ack 3230403373, win 0, length 02119.695608 ip 10.10.1.10.33460 > 10.10.1.199.49152: flags [s], seq 3289070068, win 29200, options [mss 1460,sackok,ts val 3547090335 ecr 0,nop,wscale 7], length 02119.695622 ip 10.10.1.199.49152 > 10.10.1.10.33460: flags [r.], seq 0, ack 3289070069, win 0, length 02119.695637 ip 10.10.1.10.34940 > 10.10.1.199.1029: flags [s], seq 140319147, win 29200, options [mss 1460,sackok,ts val 3547090335 ecr 0,nop,wscale 7], length 02119.695650 ip 10.10.1.199.1029 > 10.10.1.10.34940: flags [r.], seq 0, ack 140319148, win 0, length 02119.695664 ip 10.10.1.10.45648 > 10.10.1.199.5060: flags [s], seq 2203629201, win 29200, options [mss 1460,sackok,ts val 3547090335 ecr 0,nop,wscale 7], length 02119.695775 ip 10.10.1.10.49028 > 10.10.1.199.2000: flags [s], seq 635990431, win 29200, options [mss 1460,sackok,ts val 3547090335 ecr 0,nop,wscale 7], length 02119.695790 ip 10.10.1.199.2000 > 10.10.1.10.49028: flags [r.], seq 0, ack 635990432, win 0, length 0 过滤 nmap nse 脚本测试结果 本例中 nmap nse 测试脚本 http-enum.nse 用来检测 http 服务的合法 url。
在执行脚本测试的主机上:
$ nmap -p 80 --script=http-enum.nse targetip 在目标主机上:
$ tcpdump -nn port 80 | grep get /get /w3perl/ http/1.1get /w-agora/ http/1.1get /way-board/ http/1.1get /web800fo/ http/1.1get /webaccess/ http/1.1get /webadmin/ http/1.1get /webadmin/ http/1.1 抓取 dns 请求和响应 向 google 公共 dns 发起的出站 dns 请求和 a 记录响应可以通过 tcpdump 抓取到:
$ tcpdump -i wlp58s0 -s0 port 53tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on wlp58s0, link-type en10mb (ethernet), capture size 262144 bytes1406.879799 ip test.53852 > google-public-dns-a.google.com.domain: 26977+ [1au] a? play.google.com. (44)1407.022618 ip google-public-dns-a.google.com.domain > test.53852: 26977 1/0/1 a 216.58.203.110 (60) 抓取 http 有效数据包 抓取 80 端口的 http 有效数据包,排除 tcp 连接建立过程的数据包(syn / fin / ack):
$ tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<>2)) != 0)' 将输出内容重定向到 wireshark 通常 wireshark(或 tshark)比 tcpdump 更容易分析应用层协议。一般的做法是在远程服务器上先使用 tcpdump 抓取数据并写入文件,然后再将文件拷贝到本地工作站上用 wireshark 分析。
还有一种更高效的方法,可以通过 ssh 连接将抓取到的数据实时发送给 wireshark 进行分析。以 macos 系统为例,可以通过 brew cask install wireshark 来安装,然后通过下面的命令来分析:
$ ssh root@remotesystem 'tcpdump -s0 -c 1000 -nn -w - not port 22' | /applications/wireshark.app/contents/macos/wireshark -k -i - 例如,如果想分析 dns 协议,可以使用下面的命令:
$ ssh root@remotesystem 'tcpdump -s0 -c 1000 -nn -w - port 53' | /applications/wireshark.app/contents/macos/wireshark -k -i - 抓取到的数据:
img -c 选项用来限制抓取数据的大小。如果不限制大小,就只能通过 ctrl-c 来停止抓取,这样一来不仅关闭了 tcpdump,也关闭了 wireshark。
找出发包最多的 ip 找出一段时间内发包最多的 ip,或者从一堆报文中找出发包最多的 ip,可以使用下面的命令:
$ tcpdump -nnn -t -c 200 | cut -f 1,2,3,4 -d '.' | sort | uniq -c | sort -nr | head -n 20tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes200 packets captured261 packets received by filter0 packets dropped by kernel 108 ip 10.10.211.181 91 ip 10.10.1.30 1 ip 10.10.1.50 cut -f 1,2,3,4 -d '.' : 以 . 为分隔符,打印出每行的前四列。即 ip 地址。 sort | uniq -c : 排序并计数 sort -nr : 按照数值大小逆向排序 抓取用户名和密码 本例将重点放在标准纯文本协议上,过滤出于用户名和密码相关的报文:
$ tcpdump port http or port ftp or port smtp or port imap or port pop3 or port telnet -l -a | egrep -i -b5 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|login:|pass |user ' 抓取 dhcp 报文 最后一个例子,抓取 dhcp 服务的请求和响应报文,67 为 dhcp 端口,68 为客户机端口。
$ tcpdump -v -n port 67 or 68tcpdump: listening on enp7s0, link-type en10mb (ethernet), capture size 262144 bytes1450.059662 ip (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto udp (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: bootp/dhcp, request from 00xxxx:d5, length 300, xid 0xc9779c2a, flags [none] client-ethernet-address 00xxxx:d5 vendor-rfc1048 extensions magic cookie 0x63825363 dhcp-message option 53, length 1: request requested-ip option 50, length 4: 10.10.1.163 hostname option 12, length 14: test-ubuntu parameter-request option 55, length 16: subnet-mask, br, time-zone, default-gateway domain-name, domain-name-server, option 119, hostname netbios-name-server, netbios-scope, mtu, classless-static-route ntp, classless-static-route-microsoft, static-route, option 2521450.059667 ip (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto udp (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: bootp/dhcp, request from 00xxxx:d5, length 300, xid 0xc9779c2a, flags [none] client-ethernet-address 00xxxx:d5 vendor-rfc1048 extensions magic cookie 0x63825363 dhcp-message option 53, length 1: request requested-ip option 50, length 4: 10.10.1.163 hostname option 12, length 14: test-ubuntu parameter-request option 55, length 16: subnet-mask, br, time-zone, default-gateway domain-name, domain-name-server, option 119, hostname netbios-name-server, netbios-scope, mtu, classless-static-route ntp, classless-static-route-microsoft, static-route, option 2521450.060780 ip (tos 0x0, ttl 64, id 53564, offset 0, flags [none], proto udp (17), length 339) 10.10.1.1.67 > 10.10.1.163.68: bootp/dhcp, reply, length 311, xid 0xc9779c2a, flags [none] your-ip 10.10.1.163 server-ip 10.10.1.1 client-ethernet-address 00xxxx:d5 vendor-rfc1048 extensions magic cookie 0x63825363 dhcp-message option 53, length 1: ack server-id option 54, length 4: 10.10.1.1 lease-time option 51, length 4: 86400 rn option 58, length 4: 43200 rb option 59, length 4: 75600 subnet-mask option 1, length 4: 255.255.255.0 br option 28, length 4: 10.10.1.255 domain-name-server option 6, length 4: 10.10.1.1 hostname option 12, length 14: test-ubuntu t252 option 252, length 1: 10 default-gateway option 3, length 4: 10.10.1.1 5. 总结 本文主要介绍了 tcpdump 的基本语法和使用方法,并通过一些示例来展示它强大的过滤功能。将 tcpdump 与 wireshark 进行组合可以发挥更强大的功效,本文也展示了如何优雅顺滑地结合 tcpdump 和 wireshark。如果你想了解更多的细节,可以查看 tcpdump 的 man 手册。
自复式过欠压保护器辅助触点闭合故障及排除
Qorvo® 为 1.8 GHz DOCSIS® 4.0 线缆应用带来出众性能
海信手机F30S曝光将搭载虎贲T310芯片和4010mAh大容量电池
双核4G手机 三星Galaxy S III开始量产
石英MEMS传感器工作原理、敏感芯片结构及加工工艺
超详细的网络抓包神器tcpdump使用指南
大功率区域照明LED驱动电源方案
视频监控系统设备的使用环境
康佳“S”机存储器故障维修经验
电路板开发的发展趋势和流程
Wind River VxWorks支援风力发电企业开发新一代控制器系统
直接碳燃料电池的工作原理_直接碳燃料电池的优点
国外发明的机械手臂 让你拥有真正第三只手
华为宣布重大消息 新代鸿蒙5.0系统不再支持安卓
oppor11什么时候上市?oppor11最新消息:轻薄时尚颜值更高,oppor11内外兼修让人期待
2019年物联网关键技术与平台创新类、集成创新与融合应用类项目名单
物联网解决方案覆盖了商业和商业应用的大领域
另类的MR眼镜 体积只相当于太阳镜大小
如何判断led透明屏厂家哪家好?
【数转视野】PC也要数字化转型?面向未来看PC进化之路 | 2019台北电脑展特刊