1. 安装tcpdump工具

rpm -ql tcpdump          #查看tcpdump是否安装

Centos抓包方法

 

 本机是安装的,yum安装:

yum install tcpdump

 

2.  tcpdump抓包

根据协议和端口抓包

tcpdump -i eth0 udp port 694 -n              #-i指定网卡信息  udp协议

tcpdump -i eth0 tcp  port 8088 -n               #port 8088端口   tcp协议

tcpdump -i eth0 port 8088 -c 3 -t -w /tmp/tcpdump.pcap   #-c指定抓包数量   -t不显示时间戳  -w指定存放路径 

Centos抓包方法

 

 

根据主机抓包

tcpdump host 192.168.0.204 and 192.168.0.205      #两台主机之间通信抓包

Centos抓包方法

 

根据来源和目标地址抓包

tcpdump -i eth0 src host 192.168.0.235          #src指定来源

Centos抓包方法

tcpdump -i eth0 dst net 192.168.0.0/24          #dst指定目标地址,net指定网段

Centos抓包方法

详细可查看这篇文章,写的很完善https://www.cnblogs.com/magic-chenyang/p/10620600.html 

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
猜你喜欢
  • 2021-05-21
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-11-21
相关资源
相似解决方案