Securinets CTFHardware / ICS
A WHISPER IN THE AIR
The capture is a Bluetooth Low Energy sniff of six connections. Three devices do legacy passkey pairing — a "promise that should have been stronger" because the 6-digit passkey (TK) has only 10⁶ possibilities.
- Competition
Securinets CTF
- Category
- Hardware / ICSHard · estimated
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition5 min read
Brief
The challenge
- Category
- Hardware
- Points
- 389
- File
Dead-Keys.zip뿯↽frames.hex
A crowded channel carries voices, most of them harmless noise. One conversation slips between identities, guarded by a promise that should have been stronger. Follow the fragments, separate the real exchange from its decoys, and recover the message hidden in plain sight.
TL;DR
The capture is a Bluetooth Low Energy sniff of six connections. Three devices do legacy passkey pairing — a "promise that should have been stronger" because the 6-digit passkey (TK) has only 10⁶ possibilities. Brute-forcing the pairing Confirm recovers each passkey, which gives the short-term key (STK), which decrypts the key-distribution phase and yields each device's Long-Term Key (LTK). The LTKs then decrypt three later bonded reconnections.
Two reconnections are decoys (a mouse and a thermistor sensor). The real one is an HID keyboard. Its keystroke notifications are deliberately scrambled in the capture ("fragments"): each report carries a sequence number in one byte and the real keycode in another. Sorting by sequence and reading the keycode spells a Base64 string that decodes to the flag.
passkey brute (TK) -> STK -> decrypt pairing -> LTKLTK -> decrypt bonded keyboard -> reorder HID reports -> base64 -> flag01
Recon
Dead-Keys.zip contains frames.hex: 173 lines of hex, one BLE Link-Layer frame per line (some lines carry a NN| line-number prefix that must be stripped). Each frame is:
AccessAddress(4) | header(1) | length(1) | payload...Frames with access address 0x8E89BED6 (d6be898e on the wire) are advertising/CONNECT_IND; everything else belongs to a data connection keyed by its access address. Grouping gives six connections:
| Access Address | Packets | Role |
|---|---|---|
5652efa1 | 17 | pairing — "T-LITE" |
3fba5691 | 17 | pairing — "KBD-ANSI" |
07792d9c | 17 | pairing — "M-SC4" |
3c34ec3d | 106 | bonded reconnection (keyboard) |
58bf5464 | 19 | bonded reconnection ("Thermistor-X") |
5862bbd6 | 15 | bonded reconnection (mouse) |
The only plaintext L2CAP anywhere is SMP (Security Manager, CID 0x0006) — the pairing traffic. All the ATT/HID payloads are encrypted.
02
The weak promise: cracking the passkey
Each pairing connection runs LE legacy pairing with passkey entry (AuthReq has the MITM bit set). The temporary key TK is just the 6-digit passkey, zero-padded to 16 bytes. The pairing Confirm value is:
confirm = c1(TK, rand, preq || pres || iat || rat || InitA || AdvA)Every input except TK is on the wire, so TK is brute-forceable over 000000–999999. The only subtlety: the capture lists each connection's two Confirm and two Random values out of order, so the cracker tests every Confirm 뿯½ Random pairing (exactly how crackle does it). crack_passkey.py recovers:
5652efa1 (T-LITE) -> 6273413fba5691 (KBD-ANSI) -> 48320907792d9c (M-SC4) -> 19045803
From passkey to LTK
With TK known, follow the legacy key schedule (all values handled big-endian, i.e. byte-reversed from the air):
STK = e(TK, Srand[8:] || Mrand[8:])SK = e(STK, SKDs || SKDm) # SKD halves from LL_ENC_REQ / LL_ENC_RSPIV = IVm || IVsLink-layer encryption is AES-CCM with a 13-byte nonce (counter(5, little-endian) || IV), a 4-byte MIC, and a 1-byte AAD of header & 0xE3. The master뿯↽slave direction sets bit 0x80 of nonce byte 4. The MIC acts as an oracle: the correct STK verifies, confirming both the passkey and the exact byte conventions.
Because the capture is scrambled, the encrypted Encryption Information (SMP opcode 0x06) packet does not sit where you'd expect — for T-LITE it appears at a lower index than the LL_ENC_RSP. Decrypting all L2CAP packets of each pairing yields the distributed LTK:
5652efa1 -> 6b08328c043e60a5732b1979161c0ae03fba5691 -> 11eff36e379750644113081596a433c107792d9c -> dd262e86870693ad3a56d1d23a4deb8dThe accompanying Master Identification packets all carry the same EDIV=0x538c, RAND=68c5dd53392667de — the same identifiers used by the bonded reconnections, which is how each LTK maps to its reconnection.
04
Separating the real exchange from the decoys
Each bonded connection decrypts (MIC-verified) under exactly one recovered LTK:
5862bbd6뿯↽ M-SC4 LTK. Its HID report map is05 01 09 02(Mouse) 뿯↽ decoy movement noise.58bf5464뿯↽ T-LITE LTK. Device name reads "Thermistor-X"; notifications are 2-byte values that look like sensor readings 뿯↽ "harmless noise" decoy. (This is the "slips between identities" misdirection — the real keyboard is not here.)3c34ec3d뿯↽ KBD-ANSI LTK. Report map05 01 09 06(Keyboard, Report ID0x02). This is the real exchange.
05
Reassembling the fragments
The keyboard notifications are 9-byte reports of the shape:
02 [mod] 00 [b3] 00 00 00 00 [b8]Two bytes vary per report. Byte b8 ranges over a unique set 0x00..0x57 (a per-keystroke sequence number); byte b3 holds the real keycode (with mod & 0x22 = Shift). Since the frames are shuffled, sorting the reports by b8 and reading b3 (deduplicating the one retransmitted sequence) reconstructs the typed string:
U2VjdXJpbmV0c3tibDNfazN5YjBhcmRfdzM0a19US30=06
Decode
Base64-decoding gives the flag:
Securinets{bl3_k3yb0ard_w34k_TK}Solve scripts
crack_passkey.py— brute-forces the three 6-digit passkeys from the pairingConfirmvalues (crackle-exactc1).solve.py— derives STKs 뿯↽ LTKs, decrypts the bonded keyboard, reorders the HID reports and prints the flag.
$ python solve.pyRecovered LTKs: 5652efa1: 6b08328c043e60a5732b1979161c0ae0 3fba5691: 11eff36e379750644113081596a433c1 07792d9c: dd262e86870693ad3a56d1d23a4deb8d[3c34ec3d] from pairing 3fba5691 -> U2VjdXJpbmV0c3tibDNfazN5YjBhcmRfdzM0a19US30=FLAG: Securinets{bl3_k3yb0ard_w34k_TK}Flag
Flag
Securinets{bl3_k3yb0ard_w34k_TK}
Source-documented · not platform-verified
Takeaways
BLE legacy passkey pairing is only as strong as a 6-digit PIN; the
Confirmis a brute-force oracle, exactly whatcrackleautomates.Once you have the STK, the captured key distribution hands you the LTK, which decrypts every later bonded session.
The "decoys" were distinct HID device classes (mouse, fake sensor) — read the report map to tell real input from noise.
When a capture is deliberately shuffled, look for an in-band sequence number; here it was hidden in a second keyboard-report byte.