大家好,
我想专业人士的做法可能就是直接给这个仓库起一个清晰、描述性的名称,直截了当。但我在整理时,脑子里还闪过其他几个标题,比如:
总之,这就是故事。
当我正准备公开一个新漏洞时,我记起了多年前做过的一件事——我在毕业设计期间研究 Thread 和 Zigbee 等 IoT 协议时发现的一个 bug。当时我给 MITRE 发了一份报告,但再也没有收到回复,所以以为它被忽略了。
出于好奇,我重新登录了我用来提交的那个旧 Gmail 账号……结果让我惊讶的是,在 2023 年——三年后——我看到实际上已经分配了一个 CVE。
CVE-2021-27289,与我作为学生报告的漏洞相关联。
为什么花了这么长时间?当我第一次联系供应商时,他们说他们没有足够的人员来修复,并不断重复这个借口。我告诉 MITRE 似乎没有人对此采取任何行动,所以我猜他们一直在等待——可能是因为这个问题本身就不会得到修补。
该漏洞影响了 Ksix 制造的几款基于 Zigbee 的 IoT 设备。核心问题是 Zigbee 规范中定义、并通过帧计数器实施的回放保护机制没有正确实现。
由于设备没有正确检查帧计数器,攻击者只需将序列号增加到比设备上次看到的序列号更高的值,就可以与网络通信并伪造数据包。这使得重放捕获的消息并使其被接受为有效成为可能——实际上导致了身份验证绕过。
这个仓库包含我毕业设计期间所做的所有工作:
Ksix Zigbee IoT 设备受重放攻击漏洞影响,该漏洞源于 Zigbee 回放保护机制实现不当。
以下版本经测试存在漏洞。我没有测试更高版本,因此它们也可能受影响。
受影响设备中的 Zigbee 协议栈未能正确实施依赖帧计数器(Zigbee 规范中定义)的回放保护机制。该字段本应确保收到的消息是新鲜的,未被重放。
然而,在此实现中,帧计数器被忽略或未被正确验证。因此,攻击者可以捕获一个合法的 Zigbee 数据包,将其序列号增加到一个更高的值(例如 250),然后重放给网络。
由于设备仅检查序列号,它们会接受该消息为新消息——从而允许伪造通信和未经授权的操作,而无需破解任何身份验证或加密。
根据设备类型以及其集成到环境中的方式,这可能会导致用户最初用于设置网络的应用程序中出现虚假警报或虚假传感器状态(例如,检测到运动、门打开)——尽管实际上什么也没发生。在更复杂的设置中,基于伪造数据,甚至可能破坏自动化工作流或触发意外操作。
这些设备通常使用 Tuya Smart 或类似平台进行配置,当传感器被触发时(例如门打开或检测到运动),会实时通知用户。这使得以下攻击即使物理事件从未发生也特别有效。
尽管这种特定重放漏洞的直接影响有限,但更深入地理解协议——就像我在毕业设计中所探索的那样——可以揭示出那些只需最少资源就能实施的更高级攻击场景。
#!/bin/bash
function usage(){ echo -e "\nUsage: $0 [ZigbeeChannel] [SecuenceNumber] [HexDumpFile] [ShortSource] [ExtendedSource] [ShortDestination] [ShortPanId] [FCS]" echo -e "Example: $0 11 250 Open_Door_Alert_Hex_Dump 0x0001 11:ff:11:ff:11:ff:11:ff 0x0000 0x3333 0x0000 \n" echo -e "IMPORTANT: This is a script that I developed to understand how an IEEE 802.15.4 / Zigbee packet is formed, modify some fields of the packet in a simple way and see the effect when forwarding it to the network. If you want to exploit the vulnerability, follow the steps that I specify in the comments I make in the script. I exploited the vulnerability by spoofing a packet (sequence number 250) that contained the message "Door open".\n" }
function message(){ echo -e "\nProof of Concept" echo -e "There is an incorrect check of the "sequence number" field on Ksix Zigbee devices\n" echo -e "IMPORTANT: This is a script that I developed to understand how an IEEE 802.15.4 / Zigbee packet is formed, modify some fields of the packet in a simple way and see the effect when forwarding it to the network. If you want to exploit the vulnerability, follow the steps that I specify in the comments I make in the script. I exploited the vulnerability by spoofing a packet (sequence number 250) that contained the message "Door open".\n" }