Sign inSign up

animcogn/gatttool

By animcogn

Updated almost 8 years ago

This is a Dockerized version of Gatttool to modify attributes on devices

Image
0

114

animcogn/gatttool repository overview

GATTtool Docker

Follow the Github

I would recommend the Sena UD100 antenna

Gatttool with Docker works by passing through a Bluetooth dongle you have on your host machine into a docker container so that you can run it on *hopefully* any operating system without installing anything but Docker.

You pass through environment variables and it will use those paramaters to connect to a device and write a value to a specific handle over a specific inerface.

How do I find the variables?
Mac Addresses

The device MAC address can be found through a number of ways

  • Scan nearby devices with gatttool lescan / phone apps
  • Blue Hydra
Bluetooth Dongle Interfaces

Run the command hciconfig without the dongle plugged in, then rerun it with the dongle plugged in. The new entry will be the device, and will be something like hciX

Handle / Values

You can easily find handles and values by analyzing Bluetooth traffic from your phone using HCI snoop logs in Wireshark.

There's not a great way to tell what each Handle/Value actually corresponds to for the device, besides trial and error. Look and see if you can find any patterns.

Running the container

You can run it with docker run or docker-compose.

Docker Run
docker run --rm --net=host \
-e MACADDR='aa:aa:aa:aa:aa:aa' \
-e INTERFACE='hciX' \
-e HANDLE='0x0000' \
-e VALUE='123456' \
gatttool:v1
Docker-Compose
version: '3'
services:
  gatttool:
    image: gatttool:v1
    network_mode: "host"
    environment:
      MACADDR: 'aa:aa:aa:aa:aa:aa'
      INTERFACE: 'hciX'
      HANDLE: '0x0000'
      VALUE: '123456'

Tag summary

Content type

Image

Digest

Size

8.7 MB

Last updated

almost 8 years ago

docker pull animcogn/gatttool:v1