前言
介绍几种Zigbee抓包方式:
1. Ubiqua
使用教程网上非常多也非常清晰;
但是Ubiqua是收费软件,较贵;
我安装过了,费好多事,没安装成功。
2. Killerbee套件
https://github.com/riverloopsec/killerbee
Attify的集成killerbee的GUI工具:
https://github.com/attify/Attify-Zigbee-Framework
运行installer.sh安装
python main.py启动
(这个上网查的,没使用过)
3. Wireshark和TiWsPC(Wireshark Packet Converter)
TiWsPC(Wireshark Packet Converter)结合强大的Wireshark对Zigbee抓包,非常方便。
优点:好用,免费。
缺点:环境配置对新手来说有点难度。
下面介绍一下iWsPC结合强大的Wireshark对Zigbee抓包的环境配置和使用方法。
Wireshark和TiWsPC准备工作
Wireshark和TiWsPC下载
基于Wireshark和TiWsPC(Wireshark Packet Converter)的Zigbee抓包工具下载_资料下载_光明谷科技 (sunsili.com)
Wireshark和TiWsPC安装
安装对做开发的来说,应该简单,双击安装,一直下一步,直到结束。
Wireshark和TiWsPC抓包步骤
打开TiWsPc 并选择设备配置
插入USB dongle,单击"Device Configuration", 选择频道, 点击start, 如果Paackets数量有增加,则说明选择的频道,是可以的。
![](https://img-blog.csdnimg.cn/img_convert/e4a1c918dbdd0c73ed78e0991f025038.png)
选择要嗅探的IEEE通道,然后单击"开始"
![](https://img-blog.csdnimg.cn/img_convert/00cf38eb27ab7de52af17fec24aac964.png)
如果你的 TiWsPc 看起来像这样,你就可以设置 Wireshark 了
![](https://img-blog.csdnimg.cn/img_convert/9061a50a61aefe1b38fe1874355bdf77.png)
Wireshark配置使用
为 Wireshark 创建新的桌面快捷方式,并将以下内容添加到路径中:-i\\.\pipe\tiwspc_data --k
这将设置将数据从 Sniffer Agent 发送到 Wireshark 的管道。
![](https://img-blog.csdnimg.cn/img_convert/8a2e69be227909c391bd4e352cfdb241.png)
打开 Wireshark,您将看到 TiWsPc 看起来像这样。上面方法,有个问题,Wireshark可有其他用途的,
新建TiWsPc2Wireshark.bat 输入下载内容:
Wireshark.exe -i \\.\pipe\tiwspc_data -k
保存,退出。
需zigbee抓包时,只先运行TiWsPC, 并启动数据抓包。再双击运行TiWsPc2Wireshark.bat,这样使用就非常方便了。
![](https://img-blog.csdnimg.cn/img_convert/de3f6124d415e7d4fdea5288cf4e2372.png)
在 Wireshark 中,如zigbee数据加密了,需添加密钥解密。
转到编辑>首选项>协议> Zigbee 添加 Zigbee TC 链路密钥"5a6967426565416c6c69616e63653039"
![](https://img-blog.csdnimg.cn/img_convert/c83a810df616c25b4b6ff8c52170f6b5.png)
您将看到 Wireshark 在设置通道中嗅探 Zigbee 数据,如下所示。
![](https://img-blog.csdnimg.cn/img_convert/dac6233b0f41ef2cb360118c9730ea30.png)
Zigbee抓包实测
Zigbee门锁抓包数据实测
![](https://img-blog.csdnimg.cn/img_convert/46b6438c0c90cb65bd4a8f04c47db773.png)
结合代码分析:发送命令代码,18Bytes, 后面空的填0
代码如下 :
![](https://img-blog.csdnimg.cn/img_convert/7c9717057323c4b046c916088f47fd4f.png)
Zigbee开关控制数据抓包实测
![](https://img-blog.csdnimg.cn/img_convert/364ae24d6ee019cf741b2eb9153f2361.png)
结合代码分析:发送代码, 1Byte
代码如下 :
![](https://img-blog.csdnimg.cn/img_convert/e451e9369858c81f26ffe5781f344137.png)
Zigbee应用实例
我们有智能家居完整方案:
用我们zigbee模块可以免开发(零代码), 快速实现zigbee网关智能开关、智能调光灯、智能门锁、语音精灵等zigbee设备。有现成云服务(可以私有化部署)、APP(可定制)。
zigbee模块
![](https://img-blog.csdnimg.cn/img_convert/2bc03e5e380e96b478989445380b1109.jpeg)
SUN-JN5169-PA-V1.0 Zigbee模块 加PA (sunsili.com)
zigbee网关方案
【应用方案】基于MT7628 JN5169 和SUN724的4G-Zigbee智能网关方案 (sunsili.com)
![](https://img-blog.csdnimg.cn/img_convert/7746f15afa3d83e7b191d833ae6ea985.png)
智能离线语音识别全屋智能语音控制方案
![](https://img-blog.csdnimg.cn/img_convert/165f95f5d72203de70beb7c10ecef25e.png)