Skip to main content
Challenges BLE pairing: from STK to LTK
IoT Hard Bluetooth Low Energy: Legacy Pairing (Just Works), STK/LTK and an AES-CCM encrypted link Solves: 5

BLE pairing: from STK to LTK

Author: CyberSamSU
Points
100

In a smart building system there are two BLE devices: SamSU-DoorLock (a door lock) and SamSU-SmartLamp (a lamp). A phone app first paired with both using Legacy Pairing (Just Works), and later reconnected with a stored key. A radio sniffer recorded everything: ble.pcap.

File format: classic pcap, linktype 256 (BLUETOOTH_LE_LL_WITH_PHDR): each frame = a 10-byte phdr (RF channel, signal, noise, AA errors, reference access address, flags) + a Link Layer packet (Access Address, 2-byte header, payload, CRC). All LL packets are dewhitened. The AA of packets on the advertising channel = 0x8E89BED6; CONNECT_IND (PDU type 5) gives the connection AA, the addresses of both sides and the address types.

Direction: in each connection event the master (phone) sends a packet first, then the slave (device), so the order of packets for each AA is master, slave, master, slave... (there are empty PDUs too; the SN bits indicate retransmission). In encrypted packets the MIC is 4 bytes, and the CCM nonce and AAD follow Core Spec Vol 6 Part E (nonce = 39-bit packet counter | direction bit | IV, AAD = the first header byte with the NESN/SN/MD bits set to zero). An empty PDU is not encrypted and does not increment the counter.

All multi-byte fields are sent LSB-first over the air; the inputs/outputs of c1, s1 and e() (AES-128), however, are big-endian numbers, so the bytes must be reversed (Core Spec Vol 3 Part H 2.2). The MIC confirms that you derived the key correctly.

Task: The value written to handle 0x002A («Owner Key») inside the encrypted ATT Write Request sent to the SamSU-DoorLock device on reconnection is the flag: BAYROQ{...} (the last 16 characters are lowercase hex). Flag-like values written to other handles are decoys.

Attached files
ble.pcap Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −10 pts Log in
Hint 2 −20 pts Log in
Hint 3 −30 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 25.11.2026
2. Odam 25.11.2026
3. leshiy 27.11.2026
4. trzviy 27.11.2026
5. Asmaa Mottery 27.11.2026