Last active
May 23, 2025 06:44
-
-
Save jrelo/20848b3e784d1f358929d1c5af2c3ddb to your computer and use it in GitHub Desktop.
bluetoothctl cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bluetooth Hacking Cheatsheet | |
## Bluetoothctl | |
### Basic Commands | |
- **Start bluetoothctl**: | |
`bluetoothctl` | |
- **Turn on the Bluetooth adapter**: | |
`power on` | |
- **Turn off the Bluetooth adapter**: | |
`power off` | |
- **Set the Bluetooth adapter to be discoverable**: | |
`discoverable on` | |
- **Set the Bluetooth adapter to be connectable**: | |
`pairable on` | |
- **Start scanning for devices**: | |
`scan on` | |
- **Stop scanning for devices**: | |
`scan off` | |
- **List available devices**: | |
`devices` | |
- **Connect to a device**: | |
`connect [MAC Address]` | |
- **Pair with a device**: | |
`pair [MAC Address]` | |
- **Trust a device**: | |
`trust [MAC Address]` | |
- **Remove a device**: | |
`remove [MAC Address]` | |
- **Show device info**: | |
`info [MAC Address]` | |
- **Show controller (adapter) info**: | |
`show` | |
### Example Session | |
```bash | |
$ bluetoothctl | |
[bluetooth]# power on | |
[bluetooth]# discoverable on | |
[bluetooth]# pairable on | |
[bluetooth]# scan on | |
[bluetooth]# devices | |
[bluetooth]# pair AA:BB:CC:DD:EE:FF | |
[bluetooth]# connect AA:BB:CC:DD:EE:FF | |
[bluetooth]# trust AA:BB:CC:DD:EE:FF | |
Additional Tools | |
1. hcitool | |
Basic Commands | |
Scan for devices: | |
sudo hcitool scan | |
Get information about a remote device: | |
sudo hcitool info [MAC Address] | |
Inquire remote devices: | |
sudo hcitool inq | |
Get RSSI (signal strength) of a device: | |
sudo hcitool rssi [MAC Address] | |
2. gatttool | |
Basic Commands | |
Connect to a device: | |
sudo gatttool -b [MAC Address] -I | |
Discover services: | |
[MAC Address][LE]> primary | |
Read a characteristic: | |
[MAC Address][LE]> char-read-uuid [UUID] | |
Write to a characteristic: | |
[MAC Address][LE]> char-write-req [handle] [value] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment