Linux 抓包工具:tcpdump

tcpdump 是一个抓包工具,通常用来分析网络

[root@localhost ~]$ yum install -y tcpdump    # 安装tcpdump命令
[root@localhost ~]$ tcpdump -nn -i ens33                  # 抓取指定网卡的数据包
[root@localhost ~]$ tcpdump -nn -i ens33 port 22          # 抓取指定端口的数据包
[root@localhost ~]$ tcpdump -nn -i ens33 -c 10            # 抓取指定数量的数据包
[root@localhost ~]$ tcpdump -nn -i ens33 -c 10 -w 1.txt   # 指定存放到哪个文件,需要用 tcpdump -r 1.txt 查看文件内容

输出详解:

[root@localhost ~]$ tcpdump -nn -i ens33   # 如下,表示源地址 192.168.119.140:22 发送到目标地址 192.168.119.1.3453 的数据包
15:31:02.438136 IP 192.168.119.140.22 > 192.168.119.1.3453: Flags [P.], seq 391956:392232, ack 157, win 264, length 276
15:31:02.438188 IP 192.168.119.140.22 > 192.168.119.1.3453: Flags [P.], seq 392232:392396, ack 157, win 264, length 164
15:31:02.438235 IP 192.168.119.140.22 > 192.168.119.1.3453: Flags [P.], seq 392396:392560, ack 157, win 264, length 164

    

猜你喜欢

转载自www.cnblogs.com/pzk7788/p/10304228.html