1. 适用条件
适用于难把tcpdump文件从linux设备中抓下来,可以通过远程获得十六进制报文,直接转为wireshark格式。
2. 简略过程
tcpdump -xx -tt 直接把报文用十六进制打印出来
将报文导入软件TextToWiresharkFormat-v2.0.exe,转为wireshark报文
对于看DOCSIS 层的包,减去报头。editcap -C 44 capture.pcap capture_1.pcap
3. 具体操作
tcpdump -xx -tt
a. 如果是实时抓包,加端口抓,最后加-xx -tt限定抓取方式。以下的操作会直接把十六进制报文打印出来。
Server#tcpdump -i any udp port 51920 -xx -tt
b. 如果是抓取文件,可以把文件dump出来。
Server# tcpdump -r zlm.out -xx -tt
reading from file zlm.out, link-type LINUX_SLL (Linux cooked)
1521155373.167889 IP module12.58610 > smm.51919: UDP, length 73
0x0000: 0000 0001 0006 0000 ca5a 1c0d 0000 0800
0x0010: 4500 0065 0000 4000 4011 3b72 7f01 000d
0x0020: 7f01 0107 e4f2 cacf 0051 babc 0000 0040
0x0030: 0000 0000 ffff ffff ffff 5085 699c 7d20
0x0040: 0806 0001 0800 0604 0001 5085 6