Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)
1. 适用条件
【Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)】适用于难把tcpdump文件从linux设备中抓下来,可以通过远程获得十六进制报文,直接转为wireshark格式。
2. 简略过程
-
tcpdump -xx -tt
直接把报文用十六进制打印出来 - 将报文导入软件
TextToWiresharkFormat-v2.0.exe
,转为wireshark报文 - 对于看DOCSIS 层的包,减去报头。
editcap -C 44 capture.pcap capture_1.pcap
-
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)格式的新文件。
![Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)](https://img.it610.com/image/info10/6ce015508f7b41498891efd6c27711e5.jpg)
文章图片
software.txt
![Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)](https://img.it610.com/image/info10/9f787c0aa0cd47f8b814b6be2fa039f0.jpg)
文章图片
zlm.pacp
- 视情况,这里要看docsis链路层的报文,需要用wireshark自带的软件
editcap
去掉包头。
a. 如果你不知道它装在哪/有没装,可以用everything找出路径。
文章图片
path
b. windows操作系统,以管理员模式打开cmd
,进入以上的路径。把之前转的文件放到editcap
相同路径,然后在cmd
敲以下代码,editcap -C 44 zlm.pcap zlm-c.pcap
![Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)](https://img.it610.com/image/info10/32c978dc3f4e4911a3c48f1e9e11eb4a.jpg)
文章图片
admin-mode
![Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)](https://img.it610.com/image/info10/f0e9d86556c5494daad384e641d7c064.png)
文章图片
cmd
- 打开wireshark,注意
treat all packets as docsis frame
![Linux|Linux tcpdump,十六进制(hex)报文直接转wireshark格式包(docsis链路层)](https://img.it610.com/image/info10/004196ae20d946e39b0ef2d61f5109ce.jpg)
文章图片
wireshark
推荐阅读
- Linux下面如何查看tomcat已经使用多少线程
- Beego打包部署到Linux
- Linux|109 个实用 shell 脚本
- linux定时任务contab
- 芯灵思SinlinxA33开发板Linux内核定时器编程
- day16-Linux|day16-Linux 软件管理
- 如何在阿里云linux上部署java项目
- mac|mac 链接linux服务器 如何在Mac上连接服务器
- Linux|Linux 服务器nginx相关命令
- linux笔记|linux 常用命令汇总(面向面试)