Wireless Protocol Security
IoT & Embedded Security · Embedded Systems & Firmware track
6 min read
In this module
Wireless Protocols Under the Microscope
IoT devices communicate wirelessly, and wireless signals are accessible to anyone within range by definition. With wired networks, an attacker needs physical access to the cable. Wireless signals slip through walls and can be captured with cheap, off-the-shelf gear. Knowing how the common IoT wireless protocols hold up (or don't) matters whether you're attacking or defending these devices.
BLE Sniffing and Replay
Bluetooth Low Energy (BLE) is everywhere in consumer IoT: smart locks, fitness trackers, medical devices, home automation. BLE security hinges on two things: whether the devices use LE Legacy Pairing (Bluetooth 4.0/4.1) or LE Secure Connections (4.2 and later, built on ECDH), and which pairing method they pick.
Just Works: No user interaction during pairing. Provides encryption but no authentication. Under Legacy Pairing the temporary key is zero, so an attacker who captures the pairing exchange can derive the encryption key (Crackle automates this). Under Secure Connections the ECDH exchange defeats a passive sniffer, though an active man-in-the-middle still works because nothing is authenticated. This is the default for devices without a display or keypad.
Passkey Entry: A 6-digit PIN is displayed on one device and entered on the other. Under Legacy Pairing, a captured pairing exchange lets you brute-force the PIN (only 1 million possibilities) and then the key. Secure Connections commits to the passkey a bit at a time over an ECDH-protected exchange, so a passive capture doesn't give it up.
Numeric Comparison: Both devices display a number and the user confirms they match. Strong MITM protection, but it needs displays on both sides, and it exists only in Secure Connections.
The practical upshot: a passive sniffer recovers keys from Legacy pairings, and from Secure Connections pairings it gets nothing useful.
Sniffing BLE traffic:
# Using an nRF52 dongle with the nRF Sniffer firmware# Wireshark with the nRF Sniffer plugin decodes BLE packets
# Or using Ubertoothubertooth-btle -f -c /tmp/ble_capture.pcapwireshark /tmp/ble_capture.pcapReplay attacks: Some BLE devices use static commands without sequence numbers or timestamps. Capture an "unlock door" command, replay it, and you're in — assuming the device doesn't verify freshness, which plenty don't.
BLE devices expose their functionality through GATT (Generic Attribute Profile) services and characteristics. Enumerating these reveals every readable, writable, and notifiable attribute - the device's complete API over BLE. Tools like gatttool and bettercap enumerate and interact with GATT profiles, often revealing undocumented functionality.
Zigbee Key Extraction
Zigbee uses AES-128 encryption for network traffic. The weak point is how the network key gets distributed.
When a new device joins a Zigbee network, the trust centre (usually the coordinator) sends the network key to the new device. That key transport often relies on a well-known default link key: ZigBeeAlliance09, the key actually written into the Zigbee specification. An attacker who captures this exchange with a Zigbee sniffer walks away with the network key and can decrypt every subsequent packet.
# Zigbee sniffing with a Texas Instruments CC2531 USB dongle# Using Wireshark with Zigbee dissector# Configure the pre-shared key: ZigBeeAlliance09# Capture during device joining to see network key transportThe join itself is short. Follow which key protects each message and the problem is plain: everything after the join hangs off one Transport-Key message, and that message is only as secret as the trust centre link key.
Newer Zigbee 3.0 implementations support Install Codes (device-specific pre-shared keys) that shut down the default-key attack. The catch: plenty of devices in the field still ship with the default trust centre link key.
WiFi Security for IoT
IoT devices often operate on WiFi networks alongside user devices:
Deauthentication and rogue AP: An attacker sends deauthentication frames to disconnect a device from its AP, then puts up a rogue AP with the same SSID. If the device reconnects automatically without proper verification, the attacker now sits on its traffic. Protected Management Frames (802.11w) shut the first half down by authenticating deauth frames; WPA3 requires PMF, but many IoT devices still connect with WPA2 and PMF off.
Credential extraction: Many IoT devices receive WiFi credentials during setup (over BLE, a temporary AP, or WPS). If that exchange is insecure, the WiFi password leaks. Some devices stash WiFi credentials in plaintext on flash, so dumping the firmware hands you the user's home WiFi password.
Network segmentation: IoT devices on the same WiFi network as user devices make ideal pivot points. A compromised smart thermostat on the home network can scan and attack computers on the same subnet. Network segmentation (separate VLANs or SSIDs for IoT devices) takes this off the table.
LoRaWAN Security Analysis
LoRaWAN (Long Range Wide Area Network) is used for low-power, long-range IoT applications like smart meters, agriculture sensors, and asset tracking:
ABP (Activation by Personalisation): Device keys are pre-programmed. The session keys never rotate, and if the frame counter resets (typically due to a device reboot), an attacker can replay captured frames.
OTAA (Over-the-Air Activation): Keys are established through a join procedure. More secure than ABP: each join produces fresh session keys, and capturing the join messages alone doesn't reveal them.
Here's the v1.0 OTAA join. The join request travels in the clear with only a MIC; the join accept is encrypted under the AppKey. Capturing both gets an attacker the nonces but not the session keys, because deriving those still needs the AppKey. So the real OTAA risk sits with the AppKey: leak it, or reuse it across a fleet, and every captured join opens up.
Gateway impersonation: LoRaWAN gateways forward packets between devices and the network server. A rogue gateway can quietly log all device traffic within range.
LoRaWAN security tightened up in version 1.1. Version 1.0 already had a separate network session key (NwkSKey) and application session key (AppSKey); 1.1 splits the network side into three keys, adds a separate root NwkKey alongside the AppKey, makes 32-bit frame counters mandatory with stricter rules against replay, and adds rejoin requests. Plenty of devices in the field still run v1.0 with known weaknesses.
Regardless of the specific protocol, the same security principles apply: encrypted communication protects confidentiality, mutual authentication prevents impersonation, sequence numbers or timestamps prevent replay, and secure key exchange prevents interception. When any of these properties is missing or weakly implemented, the protocol is vulnerable.