Android Pentesting

ADB Commands

# install adb
sudo apt install adb

# connect to a device
adb connect <ip>:5555

# check the connected devices
adb devices
adb devices -l

# get shell on the android device
adb shell

# get the list of installed applications
adb shell pm list packages | grep <appName>

# get the path of the installed application
adb shell pm path com.app.name

# obtain apk from the installed location
adb pull /data/data/*/*/base.apk <appname.apk>

Wireless ADB

| REQUIREMENTS: Android 11

Android 11 and higher supports deploying and debugging your app wirelessly from your workstation using Android Debug Bridge (adb)

  • Connect the device and check for adb devices

  • Once the device is shown in the adb devices output, go to developers options and enable wireless debugging

  • In the shell adb tcpip 5555

  • adb connect <ip> of the mobile

  • Now the adb can be performed wirelessly

Tools Required

  • apktool

  • d2j-dex2jar

  • jd-gui

  • apkx

  • jdax

Nice Blogs

Labs

Troubleshooting

Last updated