Bluetooth and BLE Attacks
Sniffing and abusing Bluetooth devices.
Bluetooth and BLE Attacks is a free Cyber Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Bluetooth Attack Surface
Bluetooth is everywhere: headsets, locks, medical devices, fitness trackers, car infotainment, and industrial sensors. Two distinct technologies share the brand:
- Bluetooth Classic (BR/EDR) — higher throughput, used for audio and file transfer.
- Bluetooth Low Energy (BLE) — low power, used by IoT, wearables, and smart locks.
They differ in radio behavior, pairing, and protocol stacks, so attacks against one rarely apply to the other. BLE dominates IoT and is the focus of most modern assessments because of how often it is deployed insecurely.
How BLE Communicates
BLE operates in the 2.4 GHz band across 40 channels. Three of them (37, 38, 39) are advertising channels used for discovery; the other 37 carry connected data.
The core data model is GATT (Generic Attribute Profile):
- Services group related functionality.
- Characteristics are individual data points you can read, write, or subscribe to.
- Each has a UUID and a handle.
Enumerating the GATT table reveals exactly what a device exposes, which is the heart of BLE assessment.
Discovering and Enumerating Devices
Reconnaissance starts with scanning advertising packets to learn what is in range, then connecting to enumerate the GATT database.
On Linux, the BlueZ stack and tools like bluetoothctl, hcitool, and gatttool let you scan and interrogate devices. nRF Connect on a phone is an excellent graphical alternative.
# Scan for advertising BLE devices
sudo hcitool lescan
# Interactive scan and connect
bluetoothctl
scan on
connect AA:BB:CC:DD:EE:FF
# Enumerate the full GATT database
gatttool -b AA:BB:CC:DD:EE:FF --primary
gatttool -b AA:BB:CC:DD:EE:FF --characteristicsSniffing BLE Traffic
To observe communication between a device and its app, you sniff the air. Because BLE hops across channels, a sniffer must follow the connection.
- nRF52840 dongle with the nRF Sniffer plugin for Wireshark is the standard low-cost capture tool.
- Ubertooth One can capture both BLE and some Classic traffic.
- Capture during the connection event to catch the initial handshake.
Wireshark dissects captured packets into advertising data, connection requests, and GATT operations, letting you map exactly what the app reads and writes.
BLE Pairing and Its Weaknesses
BLE security depends on the pairing method chosen during bonding:
- Just Works — no user verification; vulnerable to man-in-the-middle by design. Extremely common in cheap IoT.
- Passkey Entry — a 6-digit code, stronger but brute-forceable if poorly implemented.
- Numeric Comparison — both devices show a number to confirm (LE Secure Connections).
Legacy pairing (pre-4.2) is cryptographically weak and its keys can be recovered from a captured handshake. LE Secure Connections uses ECDH and is the only method considered robust.
Cracking Legacy Pairing
When a device uses BLE legacy pairing, a captured pairing exchange can be brute-forced to recover the Temporary Key and ultimately the Long Term Key.
The tool crackle automates this against a pcap of the pairing event. Once the keys are recovered, previously encrypted traffic in the capture can be decrypted.
# Recover keys from a captured legacy pairing
crackle -i pairing_capture.pcap
# Decrypt the traffic using a recovered Long Term Key
crackle -i encrypted.pcap -o decrypted.pcap -l <recovered_ltk>Active Attacks: Spoofing and Writes
Many BLE devices trust whoever can connect. Once you enumerate writable characteristics, you can often issue commands directly without authentication.
- Unauthenticated writes — sending crafted values to a control characteristic can unlock smart locks or toggle relays.
- Device spoofing — cloning a peripheral MAC and advertisement to impersonate it to a victim app.
- GATTacker / Mirage — frameworks that man-in-the-middle a peripheral by proxying GATT traffic.
The classic finding is a smart lock whose unlock command is a static plaintext write that anyone can replay.
Man-in-the-Middle with Proxies
A BLE MITM proxy clones the target peripheral, lets the victim app connect to the clone, and relays traffic to the real device. This exposes the full conversation and allows live modification.
Frameworks like Mirage and GATTacker automate cloning advertisements and bridging two radios. You capture, modify, or replay any GATT operation in transit.
# Clone and MITM a BLE peripheral with Mirage
mirage ble_mitm TARGET=AA:BB:CC:DD:EE:FF
# Scan and enumerate as part of recon
mirage ble_scan
mirage ble_info TARGET=AA:BB:CC:DD:EE:FFClassic Bluetooth Considerations
Bluetooth Classic has its own history of issues. Notable examples include BlueBorne (a set of stack-level remote code execution flaws) and KNOB (Key Negotiation of Bluetooth), which forces the encryption key down to a brute-forceable length.
- Many headsets and car kits still accept weak or default PINs.
- Service discovery via SDP can leak device capabilities and firmware hints.
- Old stacks may be unpatched against known CVEs.
For Classic, your assessment focuses on stack version, pairing strength, and known vulnerable firmware.
Range and Tracking Privacy
BLE devices that advertise constantly create privacy and tracking risks. A static MAC address lets an observer follow a person across locations.
- MAC randomization rotates the address periodically to defeat tracking, but many devices implement it poorly or not at all.
- Identifiable advertisement payloads (fixed names, manufacturer data) can re-identify a device even with a randomized MAC.
- Long-range directional antennas extend the practical sniffing distance far beyond the nominal 10 meters.
Assessing tracking exposure is a legitimate and important part of BLE privacy review.
Hardening Bluetooth Devices
Defensive recommendations from a BLE assessment typically include:
- Use LE Secure Connections with numeric comparison; never ship Just Works for sensitive functions.
- Apply application-layer encryption and authentication on top of the link, so a MITM cannot replay or forge commands.
- Implement per-session nonces or rolling codes for control commands like unlock.
- Enable proper MAC randomization and strip identifying advertisement data.
- Keep the Bluetooth stack patched against BlueBorne, KNOB, and similar issues.
The recurring lesson: link-layer security is not enough when the application trusts any connected client.
Quick Check
Test your understanding of BLE pairing security.
Recap
You can now assess Bluetooth and BLE devices end to end:
- BLE uses 40 channels and exposes data through the GATT model of services and characteristics.
- Recon means scanning advertisements and enumerating the GATT database with BlueZ tools or nRF Connect.
- Sniffing with nRF52840 or Ubertooth feeds Wireshark for protocol analysis.
- Just Works and legacy pairing are weak; crackle recovers keys from captured legacy handshakes.
- Active attacks exploit unauthenticated writes and MITM proxies like Mirage and GATTacker.
- Defense requires LE Secure Connections plus application-layer authentication and rolling commands.
Next you will move from connected protocols to contactless tags with RFID and NFC.
Frequently asked questions
Is the “Bluetooth and BLE Attacks” lesson free?
Yes — the full text of “Bluetooth and BLE Attacks” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Bluetooth and BLE Attacks”?
Sniffing and abusing Bluetooth devices. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cyber Security Academy?
No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Bluetooth and BLE Attacks” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cyber Security Academy lesson?
Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- RF and SDR Fundamentals
- Bluetooth and BLE Attacks
- RFID and NFC Security
- Capturing and Replaying Signals