Skip to content

Problem with hex decoding in sendlcp command #84

Open
@BatrakovSV

Description

@BatrakovSV

"I'm encountering an AttributeError: 'str' object has no attribute 'decode' when trying to use the sendlcp command in the interactive CLI. I'm attempting to send a command to retrieve the battery level of a connected Bluetooth keyboard on my Android device (Nexus 5). Based on traffic analysis from macOS, where an L2CAP packet with the data 4347 is sent to the HID Control Channel (presumably CID 0x0041) for this purpose, I'm using the following command: sendlcp -c 0x000B 4347.

However, the traceback consistently points to line 1359 in internalblue/cli.py where args.data.decode("hex") is called. It appears that the decode("hex") method is being called on a string object, which doesn't have this attribute (the correct method in Python would be bytes.fromhex()).

Is this a known issue, or am I misunderstanding how to use the sendlcp command? Any guidance on how to correctly send L2CAP packets, especially in the context of sending a HID Feature Report (like 4347) to request device information, would be greatly appreciated."

`(internalblue_venv) imac_27@iMac-iMac-27 internalblue % python3 -m internalblue.cli
[!] pwnlib is not installed. Some features will not work.
[!] Couldn't import macOSCore. Is IOBluetoothExtended.framework installed?
[] No iOS devices connected
[
] Found multiple adb devices
[] Connected to 087b887d0182a9a7
[
] Chip identifier: 0x6109 (003.001.009)
[] Using fw_0x6109.py
[
] Loaded firmware information for BCM4335C0.
[] Try to enable debugging on H4 (warning if not supported)...
[
] Starting commandLoop for self.internalblue <internalblue.adbcore.ADBCore object at 0x10562acf0>


/ /_ / /____ _______ ___ / / _ )/ / _____
/ // _ / __/ -) / _ / _ `/ / _ / / // / -)
/
////_/_// ////_,////_,/_/

type <help -v> for usage information!

connect 78:CA:39:49:73:BD
[*] [Connection Create initiated]
sendlcp -c 0x000B 4347
EXCEPTION of type 'AttributeError' occurred with message: 'str' object has no attribute 'decode'
To enable full traceback, run the following command: 'set debug true'

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions