简体   繁体   English

scapy 嗅探 ZigBee 流量,不检测 ZigBee 层

[英]scapy sniffing ZigBee traffic, does not detect ZigBee layers

I'm trying to play with ZigBee protocol using scapy, but captured traffic is not properly recognized.我正在尝试使用 scapy 使用 ZigBee 协议,但无法正确识别捕获的流量。 I have created following script:我创建了以下脚本:

import sys
from scapy.sendrecv import sniff

def pkt_hnd(pkt):
    print(pkt.summary())

sniff(offline=sys.stdin.buffer, prn=pkt_hnd, store=0)

I'm feeding it with data from https://github.com/homewsn/whsniff .我用来自https://github.com/homewsn/whsniff的数据提供给它。 But packets seem incorrectly classified in scapy as SixLoWPAN / LoWPANFragmentationFirst / Raw :但是数据包在 scapy 中似乎被错误地分类为SixLoWPAN / LoWPANFragmentationFirst / Raw

Dot15d4FCS / 802.15.4 Data ( None:0x0 -> 0x2c2b:0xffff ) / SixLoWPAN / LoWPANFragmentationFirst / Raw

For comparison this is how it gets parsed by wireshark:为了比较,这是wireshark解析它的方式:

在此处输入图像描述

Can I tell scapy somehow that it should assume ZigBee traffic in these packets?我可以以某种方式告诉 scapy 它应该假设这些数据包中的 ZigBee 流量吗?

I found an answer: https://github.com/secdev/scapy/blob/cfe00d5c952e9048a40150390e0025b5ceff7228/scapy/layers/zigbee.py#L1175我找到了答案: https://github.com/secdev/scapy/blob/cfe00d5c952e9048a40150390e0025b5ceff7228/scapy/layers/zigbee.py#L1175

Current solution:当前解决方案:

import sys
from scapy.sendrecv import sniff
from scapy.config import conf

conf.dot15d4_protocol = "zigbee"

def pkt_hnd(pkt):
    print(pkt.summary())

sniff(offline=sys.stdin.buffer, prn=pkt_hnd, store=0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM