环境:CentOS7.6
1、安装
yum install tcpdump
2、监控服务器与某台主机具体端口通信的情况
tcpdump -i ens18 ip host 192.168.x.xx and 192.168.xx.xx and dst port 44317
-i参数指定具体网卡
可使用ipconfig命令查看网卡情况
3、将抓包数据输出到文件
sudo tcpdump -i any dst port 44317 >> http.cap
dst port过滤目标端口
表示抓取目标端口是44317的tcp数据包
4、使用wireshark工具分析报文
https://1.na.dl.wireshark.org/win64/Wireshark-win64-3.6.7.exe
5、文件拷贝到windows工具
https://cdn.winscp.net/files/WinSCP-5.21.2-Setup.exe?secure=DOmF02rLpUKXeG31Tw9JQA==,1661409064