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 699c 7d20
0x0050: ac10 022c 0000 0000 0000 ac10 0001 0000
0x0060: 0000 0000 0000 0000 0000 0000 0000 0000
0x0070: 6eed 39aa 0e
1521155375.214598 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 bbbc 0000 0040
0x0030: 0000 0000 ffff ffff ffff 5085 699c 7d20
0x0040: 0806 0001 0800 0604 0001 5085 699c 7d20
0x0050: ac10 022c 0000 0000 0000 ac10 0001 0000
0x0060: 0000 0000 0000 0000 0000 0000 0000 0000
0x0070: 6eed 39aa 0d
- 把這些十六進制(hex)報文放到轉換軟件中,直接轉為.pcap(適用wireshark)格式的新文件。

software.txt

zlm.pacp
- 視情況,這里要看docsis鏈路層的報文,需要用wireshark自帶的軟件
editcap去掉包頭。
a. 如果你不知道它裝在哪/有沒裝,可以用everything找出路徑。
path
b. windows操作系統(tǒng),以管理員模式打開cmd,進入以上的路徑。把之前轉的文件放到editcap相同路徑,然后在cmd敲以下代碼,editcap -C 44 zlm.pcap zlm-c.pcap

admin-mode

cmd
- 打開wireshark,注意
treat all packets as docsis frame

wireshark
