Practice library / Wireless attacks
Lab · Medium · 1.5 hoursFree account
Hardware & Bluetooth Attacks
BLE scanning, GATT attribute enumeration, and Bluetooth relay attacks.
On this page 8 sections
Bluetooth Low Energy exposes a GATT database of attributes. Each attribute carries read, write, and notify permissions, and a lazy design leaves a door unlocked. A relay sits between a phone and a lock or a car, forwards the handshake, and opens it from across the street. Real cases cover medical pumps, smart locks, and keyless cars. In this lab you scan for devices, enumerate the GATT table, and run a relay against a test target.
What You'll Learn
- Scan for Bluetooth Classic and BLE devices in range
- Enumerate GATT services, characteristics and their permissions
- Read and write unprotected BLE characteristics to change device state
- Set up a BLE relay to demonstrate man-in-the-middle risk
- Recognise common embedded weaknesses in Bluetooth deployments
- Plan the wireless and hardware sections of an assessment scope
Lab Setup
Work only against lab devices that you own. Never scan or connect to a stranger's Bluetooth device.
Authorised targets
- A BLE-enabled lab device such as an ESP32 development board running a GATT server with no pairing required. A Nordic nRF52 dongle or a cheap BLE smart lock works too.
- A second BLE adapter for the relay exercise (Step 4).
Build the ESP32 target yourself: flash one of the BLE example sketches that ships with the ESP32 Arduino core (for example BLE_write) onto your own ESP32 board with the Arduino IDE. Leave the characteristic's permissions at read and write with no encryption and no pairing required — that is the flaw Steps 2 and 3 use.
Machine and tools
- Kali Linux 2025.x or Ubuntu with BlueZ 5.66+.
- A USB Bluetooth 5.0 adapter (for example a Cambridge Silicon Radio or Realtek dongle).
bluetoothctl,hcitool,sdptool(BlueZ utilities).gatttool(BlueZ, may needbluez-toolspackage).bettercap2.32+ (BLE module for scanning, enumeration and relay).btlejack1.3+ orgattacker(optional, for relay/MitM).python3withbleaklibrary for scripted BLE interaction.
Authorised scope only. Isolated lab network. Never on production.
Step 1: Scan for Bluetooth devices
Before you can test a device you need to find it. Bluetooth Classic and BLE use different discovery protocols. A broad scan catches both.
Bring the adapter up and scan for Classic devices.
sudo hciconfig hci0 up
hcitool scanScanning ...
00:11:22:33:44:55 Lab-SpeakerNow scan for BLE devices. bluetoothctl handles both, but hcitool lescan is faster for a quick sweep.
sudo hcitool lescan --duplicatesLE Scan ...
AA:BB:CC:DD:EE:FF Lab-BLE-Lock
AA:BB:CC:DD:EE:FE ESP32-GATT-Server
11:22:33:44:55:66 (unknown)Press Ctrl+C after 10 seconds. Each line is a device advertising nearby. (unknown) means the device does not broadcast a name. Note the address of your lab target, for example AA:BB:CC:DD:EE:FE.
For a richer view, use bettercap.
sudo bettercap -eval "ble.recon on"[ble.device.new] BLE device AA:BB:CC:DD:EE:FE detected as ESP32-GATT-Server (-42 dBm).
[ble.device.new] BLE device AA:BB:CC:DD:EE:FF detected as Lab-BLE-Lock (-55 dBm).Bettercap shows signal strength, which helps you tell close devices from distant ones.
Step 2: Enumerate GATT services and characteristics
BLE devices expose data through GATT (Generic Attribute Profile). Services group related characteristics. Each characteristic has permissions: read, write, notify. An unprotected write characteristic is attack surface.
Connect to the lab device and list its services.
gatttool -b AA:BB:CC:DD:EE:FE -I[AA:BB:CC:DD:EE:FE][LE]> connect
Attempting to connect to AA:BB:CC:DD:EE:FE
Connection successful
[AA:BB:CC:DD:EE:FE][LE]> primary
attr handle: 0x0001, end grp handle: 0x0005 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0014, end grp handle: 0x001a uuid: 0000ff10-0000-1000-8000-00805f9b34fbThe first UUID (1800) is the standard Generic Access service. The second (ff10) is a vendor-specific service. List its characteristics.
[AA:BB:CC:DD:EE:FE][LE]> characteristics 0x0014 0x001a
handle: 0x0015, char properties: 0x0a, char value handle: 0x0016, uuid: 0000ff11-...
handle: 0x0018, char properties: 0x02, char value handle: 0x0019, uuid: 0000ff12-...The property byte 0x0a means read (0x02) + write (0x08). 0x02 alone is read-only. Handle 0x0016 is writable.
Sign in to continue
5 more sections are for signed-in members. It is free: sign in with Google.