bluetoothctl
list
- List controllers (usually one)
# List controllers
bluetoothctl list
show
- Show controllers information
bluetoohctl show
info
- Information about connected devices
bluetoothctl info
# Show info about a device (from /var/lib/bluetooth/<controller-id>/<device-id>/info)
bluetoothctl info "mac-addr"
devices
# List available devices
bluetoothctl devices # all
bluetoothctl devices Paired
bluetoothctl devices Bonded
bluetoothctl devices Trusted
bluetoothctl devices Connected
Pairing
# Scan devices
bluetoothctl scan on
# Pair
bluetoothctl pair "mac-addr"
# Cancel pairing process
bluetoothctl cancel-pairing "mac-addr"
# Unpair
bluetoothctl remove "mac-addr"
Connection
# Connect
bluetoothctl connect "mac-addr"
# Disconnect
bluetoothctl disconnect "mac-addr"
Trust
# Trust
bluetoothctl trust "mac-add"
# Untrust
bluetoothctl untrust "mac-add"
Cross OS pairing
- Bluetooth info is stored at
/var/lib/bluetooth/<controller-id>/<device-id>/info
-
This bluetooth connection keys must be the same across the OS's
-
Conventional bluetooth devices
-
LinkKey
-
BLE devices
- IdentityResolvingKey (Remote IRK)
- PeripheralLongTermKey (Long-term Key)
- SlaveLongTermKey (Long-term Key)
Alongside MacOS
- Access
Keychain access
-
Search for "bluetooth"
-
Conventional bluetooth devices
-
Show up as
MobileBluetooth
-
BLE devices
- Show up as an
UUID
- These devices generate an increasing UUID on each pairing. In that case, get the exact UUID on MacOS and rename the folder on linux
- Long-term Key and Remote IRK are base64 encoded, use the command below to convert it
# Decode keys from base64 into hex
echo -n "mykeybase64" | base64 -d | od -t x1 -An | tr -d ' ' | tr "[a-z]" "[A-Z]"
Alongside Windows
- Get the keys with
chntpw