Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

TCP Connection Error on API29 #164

@bannsec

Description

@bannsec

Trying to use python adb to connect to an emulated API29 device over TCP. Failing spectacularly.

In [6]: d = device.ConnectDevice(serial="127.0.0.1:5554")
---------------------------------------------------------------------------
InvalidCommandError                       Traceback (most recent call last)
<ipython-input-6-7567c46f5431> in <module>
----> 1 d = device.ConnectDevice(serial="127.0.0.1:5554")

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_commands.py in ConnectDevice(self, port_path, serial, default_timeout_ms, **kwargs)
    140                     timeout_ms=default_timeout_ms)
    141
--> 142         self._Connect(**kwargs)
    143
    144         return self

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_commands.py in _Connect(self, banner, **kwargs)
    171             banner = socket.gethostname().encode()
    172
--> 173         conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
    174
    175         # Remove banner and colons after device state (state::banner)

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_protocol.py in Connect(cls, usb, banner, rsa_keys, auth_timeout_ms)
    312             data=b'host::%s\0' % banner)
    313         msg.Send(usb)
--> 314         cmd, arg0, arg1, banner = cls.Read(usb, [b'CNXN', b'AUTH'])
    315         if cmd == b'AUTH':
    316             if not rsa_keys:

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_protocol.py in Read(cls, usb, expected_cmds, timeout_ms, total_timeout_ms)
    245             if not command:
    246                 raise InvalidCommandError(
--> 247                     'Unknown command: %x' % cmd, cmd, (arg0, arg1))
    248             if command in expected_cmds:
    249                 break

InvalidCommandError: ('Unknown command: 72646e41', 1919184449, (543451503, 1936617283))

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