Abusing the Android Debug Bridge

The android debug bridge (or ADB for short) is avaluable tool, it is what allows smart phone tinkerers unobstructed access totheir device for customization. This said, the debug bridge has a major caveatof being too easily left on, and requiring no authentication before grantingaccess. ADB can expose your phone to anyone who can gain physical access or is onthe same network.

The tools to access ADB are free to download (they are bundled with the Android SDK) and allow access to all of the commands listed here: http://developer.android.com/tools/help/adb.html

Some of the more powerful actions are:

  • Install applications onto the phone.
  • Copy files to and from the device.
  • Open an interactive shell on the device.

If you've used ADB before, you know the standardapproach is to access ADB via USB. Turn on USB debugging, plug in your phone to your computer and have fun! The caveat here is, when you unplug your phone, USB debugging is notalways turned back off and it is not always apparent that it has been left on.The next time you plug your phone in to a USB port, if debugging was left onyou have opened your phone up for attack.

I should clarify that these settings are unique to the OS you have installed on your phone, some operating systems turn off ADB automatically when you un plug from the network or USB host while others come shipped with ADB turned on by default. To expand on this below is the status bar from three different devices showing how each operating system decided to show if ADB has been turned on:


All of the above phones have debugging turned on, and are plugged in. The icon on the far left states USB is connected, and on the two top examples they also report that USB debugging is turned on/active. For those who are curious, the order of the devices are a development HTC one, Stock Motorola , and finally a rooted phone with a common customized rom.

Seems safe right? Well I have encountered no devices or roms that give you the same notice in the status bar when ADB is enabled over the network, here is the same HTC development phone's status bar with ADB over the network enabled and currently connected:


The two most publicized attacks related to thisare juicejacking and a physical driveby. Juice jacking involves settingup a malicious charging kiosk, or malware on a computer; so that when a phone or tablet has beenplugged in an automated attack is initiated against the device. The physicaldrive by attack is when the attacker maximizes the short period of time a phonemay be left unattended (such as in a public setting) in order to exfiltrate asmuch data as possible. With these physical drive-by attacks, it is also trivialto setup a network backdoor immediately, by setting an option that turns ADB onover the network. An attacker could plug in to your phone at a coffee shop andenable ADB over the network with a single command, that's faster than it takes you to retrieve your beveragefrom the counter. Once that is done, they can return to their laptop andcontinue the attack for as long as you remain on the coffee shop's wifi.

ADB over the network only exasperates theproblem, as shown above. It may help with managing a large numberof devices on a safe and secured network, but it has a severe problem: Not onlyis it unauthenticated full access to the phone over the network, ADB binds toevery interface and IP address the device is connected to (including the cellular data network) and has no status bar notification. This places a large amount of trust that your cell provider hasproperly secured their cellular data network from allowing directly connectingto other devices on the data network.

How big of a threat is this really? While thepayoff is immense, the likelihood someone has ADB enabled is low. An average android user typical has no reason to enable it, and it would be unlikely fora phone modder/tinkerer/hacker who is conscientious about this threat to leaveit on. There is a sweet spot though; anyone who leaves this option on forconvenience or by accident, and it happens. I have personally seen 2 occasionswhere a device had ADB turned on unbeknownst to the device's owner, when explaining this threat to people overthe past year.

All you need to do to secure your phones and make sure this option is turned off thisoption when it's not in use. The option is in the phone's settings under the Developer menu:


Our TrustKeeper Scan Engine has recently been updated to include tests to detect devices with this insecure feature enabled on the network.

Trustwave reserves the right to review all comments in the discussion below. Please note that for security and other reasons, we may not approve comments containing links.