linux 抓包方法
安装net-tools
yum -y install net-tools
这步很关键,如果不安装的话无法使用 ifconfig 命令查看网卡
安装 tcpdump
这个是抓包的主要工具
yum install tcpdump -y
安装yum install bridge-utils
这个可装可不装,方便查看网桥
brctl show
确认网卡
输入 ifconfig
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.88.10.212 netmask 255.255.255.0 broadcast 10.88.10.255
inet6 fe80::250:56ff:fea9:dfb3 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:a9:df:b3 txqueuelen 1000 (Ethernet)
RX packets 129812955 bytes 104734731775 (97.5 GiB)
RX errors 0 dropped 277 overruns 0 frame 0
TX packets 88809687 bytes 96828970033 (90.1 GiB)
确认该网卡为本机ip
image.png
开始抓包
tcpdump tcp -i ens192 -t -s 0 port 83 -w wms.cap #通过端口
tcpdump -i ens192 host 10.88.10.202 -w mes.cap #通过 ip 地址
命令解析
当执行完该命令时可以将该文件下载至本地。通过 wireshark open 打开
wireshark