hackgnar / ble_ctf

A Bluetooth low energy capture the flag
671 stars 97 forks source link

Configure gatttool In Kali? #3

Closed decidedlygray closed 6 years ago

decidedlygray commented 6 years ago

I was wondering if you might know if there is anything special you have to do in order to get gatttool to play nice with Kali Linux?

I'm able to use hcitool to lescan, find my device. When I try to use gatttool I get a connection refused error:

root@kali-vm:~# gatttool -b b4:e6:2d:96:14:7F --char-read -a 0x002a
connect: Connection refused (111)
root@kali-vm:~# gatttool --adapter=hci1 -I
[                 ][LE]> connect b4:e6:2d:96:14:7F
Attempting to connect to b4:e6:2d:96:14:7F
Error: connect: Connection refused (111)

I am able to connect to the device and read GATT data using nRF Connect from an Android device, so the device itself seems to be working fine. I also made sure my Android device was disconnected and bluetooth was disabled before trying to connect from Kali.

Any pointers on getting this set up right?

decidedlygray commented 6 years ago

I Googled even harder and solved my problem. LE isn't on by default. You need to run this to enable it in Kali:

root@kali-vm:~# btmgmt le on

Then it all works :smile: