Re iot proto

From dslsdzc/rev-skills · View interactive version

Re iot proto is an AI agent skill from the GitHub repository dslsdzc/rev-skills. 物联网协议:MQTT/CoAP/BLE/Zigbee;BLE 链路层(广播解析/配对加密)与 NFC/智能卡(ISO14443/APDU/MIFARE)。 触发词:MQTT、CoAP、BLE、Zigbee、物联网协议、IoT协议、BLE链路、BLE嗅探、广播解析、配对加密、GATT、NFC、智能卡、MIFARE、APDU、ISO14443

How to use this skill

Skill file

物联网协议逆向(MQTT / CoAP / BLE / Zigbee / NFC 智能卡)

何时使用 / 何时不用

工具准备

物理设备抓包注意授权边界(见步骤 5),动态场景默认沙箱 / 隔离网络([[re-analyze/platform-tips]] 最高原则)。所有工具先验证再使用。

wireshark / tshark —— 解析主力(MQTT/CoAP/BLE/Zigbee dissector 内置)

scapy —— 可选解析 / 构造

MQTT —— mosquitto 客户端(主动订阅/发布验证)

CoAP —— coap-client / aiocoap

BLE —— bluez + ubertooth

Zigbee —— Wireshark + sniffer 硬件 + KillerBee

操作步骤

按顺序执行,每步产物(pcap / 密钥 / 解析脚本 + sha256)存档。

  1. 协议识别:

```sh

tshark -r cap.pcap -q -z io,phs # 协议分层统计

tshark -r cap.pcap -T fields -e tcp.dstport -e udp.dstport | sort | uniq -c | sort -rn

```

  1. MQTT/CoAP 解析(topic / payload):

```sh

tshark -r cap.pcap -Y mqtt -T fields -e mqtt.topic -e mqtt.msg

tshark -r cap.pcap -Y 'mqtt.topic contains "ota"' -T fields -e mqtt.msg # 按主题过滤

tshark -r cap.pcap -Y coap -T fields -e coap.code -e coap.uri_path -e coap.opt.content_format

```

  1. BLE 抓包(adv / GATT):

```sh

tshark -r ble.pcap -Y btatt -T fields -e btatt.opcode -e btatt.uuid -e btatt.value

```

  1. Zigbee(802.15.4):
  1. 设备固件联动(走 [[re-firmware]]):

BLE 链路层

应用层之外补链路层视角:空口嗅探、广播/连接帧结构、配对加密协商与密钥定位。抓包工具底座见上文「BLE —— bluez + ubertooth」,本节侧重链路语义与深挖点。

嗅探硬件与软件(泛化选购指引)

广播包解析

连接事件时序与信道 37/38/39

配对 / 加密协商

GATT 服务与特征枚举

坑与陷阱

NFC / 智能卡

接触式 / 无接触智能卡:ISO14443 链路、APDU 交互与常见卡族弱点。硬件用 proxmark3 类通用读写器(泛化选购),抓取/分析前确认授权边界。

ISO14443 帧结构与防冲突流程

APDU 交互

MIFARE Classic 与 Crypto-1 弱点(泛化)

proxmark3 类设备流程(泛化选购)

坑与陷阱

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.