Skip to content
Pwnversity
WL-BLEintermediate · 5 min · upd. 2026-10

Bluetooth and BLE

Bluetooth Low Energy (BLE) is everywhere: wearables, smart locks, medical devices, car keys, toys, and IoT sensors. Many were designed prioritizing ease and low power over security, so it’s common to find unencrypted communication, weak or absent authentication, and exposed sensitive data. Auditing BLE means discovering devices, mapping their services and characteristics (GATT), and reading/writing/intercepting what shouldn’t be accessible.

Only against your own devices or an authorized engagement. Intercepting or tampering with other people’s BLE devices is illegal.

BLE is an open, short-range medium: anyone in range (a few meters, more with a directional antenna) sees the advertising and can try to connect. The security model depends on pairing: Just Works (no authentication, very common in cheap IoT) doesn’t protect against MITM; Passkey and OOB do authenticate; LE Secure Connections (BLE 4.2+) uses ECDH and is the recommended choice. The recurring failure isn’t breaking crypto, but that a characteristic performing a sensitive action (open a lock, send a command) doesn’t check authentication: anyone in range invokes it.

After connecting, the client explores the GATT, the device’s data structure: Services containing Characteristics, each with a value and properties (read/write/notify). Each characteristic has a handle.

flowchart TD
    A[Advertising: the device announces itself] --> B[Scan + Connect]
    B --> C[Enumerate GATT: services and characteristics]
    C --> D{Pairing}
    D -->|Just Works| E[No auth: MITM and free writes]
    D -->|LE Secure Connections| F[ECDH: resists MITM]
    E --> G[Read/write sensitive characteristics]
    E --> H[Sniffing + command replay]

Security modes: Just Works (no auth, weak), Passkey Entry, OOB, LE Secure Connections (authenticated with ECDH).

The laptop’s built-in BLE adapter works to start; for more range or sniffing, CSR/Nordic dongles or an Ubertooth One. A phone with nRF Connect is convenient for exploring.

Ventana de terminal
bluetoothctl # scan on -> list nearby devices
hcitool lescan # BLE scan (legacy but useful)
sudo btmgmt find # modern BlueZ alternative
Ventana de terminal
gatttool -I -b AA:BB:CC:DD:EE:FF # interactive mode: primary, char-desc, char-read-hnd
bettercap -eval "ble.recon on" # bettercap: ble.recon on ; ble.enum <MAC>
# nRF Connect (Android/iOS): view and write characteristics conveniently

Map which services/characteristics the device exposes and which allow read/write/notify.

Ventana de terminal
# write a characteristic without authentication (e.g. a command to a lab lock)
gatttool -b AA:BB:CC:DD:EE:FF --char-write-req -a 0x0012 -n 01
# read a characteristic
gatttool -b AA:BB:CC:DD:EE:FF --char-read -a 0x0012
  • Read/write with no auth: the characteristic performs the action without checking who called.
  • Replay: capture a legitimate command (sniffing) and resend it if there’s no anti-replay.
  • Lack of encryption: sniffing reveals cleartext commands and data.
  • MITM of Just Works pairing: proxy between app and device.
  • Characteristic fuzzing: trigger crashes or unexpected behavior.
Ventana de terminal
# capture BLE traffic (requires sniffing hardware)
ubertooth-btle -f -c capture.pcap # Ubertooth One -> Wireshark
# nRF Sniffer (Nordic) as an extcap in Wireshark
# MITM with an app<->device proxy: GATTacker, BtleJuice
  • LE Secure Connections with authenticated pairing (Passkey/OOB); never Just Works for sensitive actions.
  • Encrypt the communication and authenticate commands at the application level (don’t rely on link-layer pairing alone).
  • Don’t expose sensitive characteristics without authentication; validate who writes.
  • Anti-replay (nonces, monotonic counters) and key rotation.
  • MAC randomization for privacy; minimal advertising surface.
  • BLE hardware and tools (bluetoothctl / gatttool / nRF Connect)
  • Discover devices and map GATT (services/characteristics)
  • Read characteristics without authentication
  • Write sensitive characteristics (open/command) without auth
  • Traffic sniffing (unencrypted?) and command replay
  • Identify the pairing mode (Just Works vs authenticated)
  • MITM the pairing (GATTacker / BtleJuice)
  • Blue: LE Secure Connections, app-level auth, anti-replay?