<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# API Reference — Performing Mobile Bluetooth Security Testing

## hcitool
```bash
hcitool scan                                    # Classic BT discovery
hcitool lescan                                  # BLE discovery
hcitool lescan --duplicates                     # Include duplicates
hcitool info AA:BB:CC:DD:EE:FF                  # Device info
hcitool cc AA:BB:CC:DD:EE:FF                    # Create connection
```

## gatttool
```bash
gatttool -b ADDR --primary                      # List primary services
gatttool -b ADDR --characteristics              # List characteristics
gatttool -b ADDR --char-desc                    # List descriptors
gatttool -b ADDR --char-read -a 0x0025          # Read handle
gatttool -b ADDR --char-write-req -a 0x0025 -n 0100  # Write handle
gatttool -b ADDR --listen                       # Listen for notifications
gatttool -b ADDR -I                             # Interactive mode
```

## btlejack
```bash
btlejack -s                                     # Scan active connections
btlejack -f AA:BB:CC:DD:EE:FF                   # Follow device
btlejack -f AA:BB:CC:DD:EE:FF -o capture.pcap   # Capture to PCAP
btlejack -c any                                 # Sniff any connection
```

## Ubertooth
```bash
ubertooth-btle -f -t AA:BB:CC:DD:EE:FF          # Follow BLE device
ubertooth-btle -f -c capture.pcap                # Capture to PCAP
ubertooth-btbb -l                                # Classic BT LAP scan
ubertooth-scan                                   # Active scanning
```

## Android HCI Snoop Log
```bash
adb shell settings put secure bluetooth_hci_log 1   # Enable
adb pull /data/misc/bluetooth/logs/btsnoop_hci.log   # Pull log
adb shell settings put secure bluetooth_hci_log 0    # Disable
```

## BLE UUID Reference
| UUID | Service |
|------|---------|
| 0x1800 | Generic Access |
| 0x1801 | Generic Attribute |
| 0x180A | Device Information |
| 0x180D | Heart Rate |
| 0x180F | Battery Service |
| 0x1812 | HID (Human Interface) |
