Exploiting Android Through ADB
What is ADB?
Android debug bridge – It is a command line tool that allows you to communicate with a device, it is used mainly for debugging.
The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.
The 3 main elements of ADB
It is a client-server interface that includes three components:
- Client – Used to send commands. Runs on your computer.
- The adbd or the adb daemon – Runs on the target device in the background as a service. It is responsible for executing commands on the target device.
- The server – The server runs in the background of the client machine or computer.
How adb works
- When you start the client, it checks whether there is an existing adb process running, if there isn’t one it starts the server process.
- When the server process starts, it binds to the local TCP port 5037 and listens for commands sent from the adb client .
- The adb client always uses port 5037 to communicate with the adb server.
- The server will now attempt to connect to all running devices it does this by scanning ports from the range of 5555 to 5585. When it finds a adb daemon running(target) it will setup a connection to that port.