Wireshark 提示和技巧

阅读: 评论:0

Wireshark 提示和技巧

Wireshark 提示和技巧

Linux cooked-mode capture (SLL)


使用 Wireshark 做数据包分析时,有时候分组详情中的数据链路层会显示 Linux cooked capture ,这是 Linux 上 libpcap 所使用的伪协议(pseudo-protocol),有两种可能的情形:

  1. 数据包从 “any” 设备进行捕获(即 tcpdump -i any,Pseudo-device),因为不是所有接口都具有相同的链路层类型。
[root@localhost ~]# tcpdump -D
1.eno1
2.usbmon1 (USB bus number 1)
3.eno2
4.usbmon2 (USB bus number 2)
5.enp59s0f0
6.enp59s0f1
7.any (Pseudo-device that captures on all interfaces)
8.lo
[root@localhost ~]# tcpdump -i any
  1. 数据包从链路层头部不可用或不能使用的设备上进行捕获(譬如Linux PPP),因为 Linux PPP 代码不能可靠地向 libpcap 提供 PPP 报头。

示例数据包






SLL数据包格式


								+---------------------------+|         Packet type       ||         (2 Octets)        |+---------------------------+|        ARPHRD_ type       ||         (2 Octets)        |+---------------------------+| Link-layer address length ||         (2 Octets)        |+---------------------------+|    Link-layer address     ||         (8 Octets)        |+---------------------------+|        Protocol type      ||         (2 Octets)        |+---------------------------+|           Payload         |.                           ..                           ..                           .
  1. Packet type(2字节)
  • 0, if the packet was specifically sent to us by somebody else;

  • 1, if the packet was broadcast by somebody else;

  • 2, if the packet was multicast, but not broadcast, by somebody else;

  • 3, if the packet was sent to somebody else by somebody else;

  • 4, if the packet was sent by us.

  1. ARPHRD_ type(2字节)
    链路层地址类型,Linux ARPHRD_ value,譬如 1 以太网

  2. Link-layer address length(2字节)
    数据包发送方的链路层地址长度,可以为 0

  3. Link-layer address(8字节)
    数据包发送方的链路层地址

  4. Protocol type(2字节)
    协议类型字段

详见 .html


Wireshark 显示过滤


sll 过滤 SLL-based 流量
sll.pkttype 过滤 Packet type ,例 sll.pkttype == 0
sll.hatype 过滤 Link-layer address type ,例 sll.hatype == 1
sll.halen 过滤 Link-layer address length ,例 sll.halen == 6
h 过滤 source mac,例 h == 00:00:00:00:00:00
pe 过滤协议类型,例



感谢阅读,更多技术文章可关注个人公众号:Echo Reply ,谢谢。

本文发布于:2024-01-29 09:57:52,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170649347714483.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

下一篇:v.npm
标签:提示   技巧   Wireshark
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23