Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE: Cannot connect to device multiple times. Hangs. #471

Closed
glassdonut opened this issue Mar 5, 2019 · 3 comments
Closed

BLE: Cannot connect to device multiple times. Hangs. #471

glassdonut opened this issue Mar 5, 2019 · 3 comments

Comments

@glassdonut
Copy link

Issuing a command that connects to a BLE device works the first time. But subsequent connection attempts hang on "connecting to ...". This is not just multiple ble.enum attempts, but multiple ble connection attempts.

Environment

Please provide:

  • Bettercap version you are using: newest release (v2.18)
  • OS version and architecture you are using: Ubuntu v18.04.2
  • Go version if building from sources: n/a
  • Command line arguments you are using: bettercap -debug
  • Caplet code you are using or the interactive session commands: n/a
  • Full debug output while reproducing the issue ( bettercap -debug ... ).

bettercap v2.18 (type 'help' for a list of commands)
*disable net recon, enable and disable ble.recon*

>> ble.write 00:11:22:33:44:55:66 abcd 00
[sys.log] [inf] ble.recon connecting to 00:11:22:33:44:55:66 ...
[sys.log] [inf] ble.recon connected, enumerating all the things for 00:11:22:33:44:55:66!
[sys.log] [err] ble.recon writable characteristic abcd not found.
[sys.log] [inf] ble.recon disconnecting from 00:11:22:33:44:55:66 ...

>> ble.write 00:11:22:33:44:55:66 abcd ff
[sys.log] [inf] ble.recon connecting to 00:11:22:33:44:55:66 ...
HANGS HERE

(note: this happens with any combination of connection attempts from different commands (enum, write, etc). does not matter if the command fails (as it did here) or succeeds.

Steps to Reproduce

  1. run bettercap
  2. get devices with ble.recon on -> ble.recon off
  3. ble.enum or ble.write to any device.
  4. ble.enum or ble.write to the device again. (hangs)

Expected behavior: What you expected to happen
The connection to succeed and the command to complete again.

Actual behavior: What actually happened
Nothing after the "connecting to ..." message. Must restart session to re-issue these commands.

@evilsocket
Copy link
Member

did you try other devices and/or other bluetooth adapters? because i can't reproduce

@glassdonut
Copy link
Author

glassdonut commented Mar 7, 2019

Yep, tested with different bluetooth devices and different adapters, same issue :\

Will reinstall clean and see if that helps. Pulling clean master repo again didn't change anything.

@codeholio
Copy link

I may be encountering this too, I have a trigger to ble.enum on any ble.device.new event and it only completes on the first hit of the trigger, then hangs and sometimes leaves the ble adapter in a bad state requiring hciconfig up/down before resuming. v2.19

evilsocket added a commit to bettercap/gatt that referenced this issue Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants