From 50e8ba73d8664dd4c8cd2309ff74b6825d151309 Mon Sep 17 00:00:00 2001 From: CPol Date: Sun, 4 Jul 2021 09:43:18 +0000 Subject: [PATCH] GitBook: [master] 492 pages modified --- .../android-app-pentesting/adb-commands.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mobile-apps-pentesting/android-app-pentesting/adb-commands.md b/mobile-apps-pentesting/android-app-pentesting/adb-commands.md index 397e948b2..676ff5ab6 100644 --- a/mobile-apps-pentesting/android-app-pentesting/adb-commands.md +++ b/mobile-apps-pentesting/android-app-pentesting/adb-commands.md @@ -40,6 +40,32 @@ adb server version (41) doesn't match this client (36); killing... It's because you are trying to connect to an ADB server with a different version. Just try to find the adb binary the software is using \(go to `C:\Program Files\Genymobile\Genymotion` and search for adb.exe\) +### Several devices + +Whenever you find **several devices connected to your machine** you will need to **specify in which one** you want to run the adb command. + +```bash +adb devices +List of devices attached +10.10.10.247:42135 offline +127.0.0.1:5555 device +``` + +```bash +adb -s 127.0.0.1:5555 shell +x86_64:/ # whoami +root +``` + +### Port Tunneling + +In case the **adb** **port** is only **accessible** from **localhost** in the android device but **you have access via SSH**, you can **forward the port 5555** and connect via adb: + +```bash +ssh -i ssh_key username@10.10.10.10 -L 5555:127.0.0.1:5555 -p 2222 +adb connect 127.0.0.1:5555 +``` + ## Packet Manager ### Install/Uninstall