Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sniffing/logging your own Android Bluetooth traffic

I recently bought chinesse device that connects via bluetooth with android phone / tablet. Since there is no application availible for windows / linux I want to create one for personal usage.

Usually phone connects to the device and exchanges some data. I connected PC to the device and looked into serial debugger and menaged to discover the protocol (one way only). Phone sends only one command to the device. But this time I'm not able to find out what it containts.

Is there any software that will allow me to look into data sent via bluetooth? I tried decompiling the app, but it looks really unfriendly.

Thanks.

like image 917
peku33 Avatar asked May 26 '14 21:05

peku33


People also ask

Can you sniff Bluetooth traffic?

On the applicable Android devices, it is possible to capture Bluetooth traffic as follows: Go to Settings. If developer options is not enabled, enable it now. Go into developer options.

What is Bluetooth snoop log?

Bluetooth HCI snoop logs capture Bluetooth packets sent and received from devices so as to report errors.

Can Wireshark capture Bluetooth packets?

It works only on Android >= 4.4. Once the application is audited in this way, you still have work to do to understand if the information passed in the Bluetooth communication is properly protected by, for example, Bluetooth encryption.

Where is Bluetooth HCI snoop log?

These logs capture the Host Controller Interface (HCI) packets. For most Android devices, the logs are stored in data/misc/bluetooth/logs .


2 Answers

Android 4.4 (Kit Kat) does have a new sniffing capability for Bluetooth. You should give it a try.

If you don’t own a sniffing device however, you aren’t necessarily out of luck. In many cases we can obtain positive results with a new feature introduced in Android 4.4: the ability to capture all Bluetooth HCI packets and save them to a file.

When the Analyst has finished populating the capture file by running the application being tested, he can pull the file generated by Android into the external storage of the device and analyze it (with Wireshark, for example).

Once this setting is activated, Android will save the packet capture to /sdcard/btsnoop_hci.log to be pulled by the analyst and inspected.

Type the following in case /sdcard/ is not the right path on your particular device:

adb shell echo \$EXTERNAL_STORAGE 

We can then open a shell and pull the file: $adb pull /sdcard/btsnoop_hci.log and inspect it with Wireshark, just like a PCAP collected by sniffing WiFi traffic for example, so it is very simple and well supported:

screenshot of wireshark capture using Android HCI Snoop

[source]

You can enable this by going to Settings->Developer Options, then checking the box next to "Bluetooth HCI Snoop Log."

like image 60
Stephan Branczyk Avatar answered Sep 21 '22 12:09

Stephan Branczyk


Also, this might help finding the actual location the btsnoop_hci.log is being saved:

adb shell "cat /etc/bluetooth/bt_stack.conf | grep FileName" 
like image 45
maximevince Avatar answered Sep 20 '22 12:09

maximevince