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: src/mobile-pentesting/android-app-pentesting/README.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,87 @@ Instead of custom sockets, some malware uses **Firebase Cloud Messaging (FCM)**
127
127
128
128
Native payloads can be delivered as encrypted ELF blobs and decrypted with `CipherInputStream()`, using a key **derived from SHA‑1 of the downloaded filename**. Each filename/version yields a distinct key, hindering static IOC reuse.
129
129
130
+
### OEM system-app droppers and `customer.prop` root backdoors
131
+
132
+
Cheap Android TVs/projectors and other OEM devices sometimes ship with **privileged system apps** signed with **AOSP test keys** or an OEM platform key, plus **weak boot-property handling**. Treat these builds as both an Android-app and firmware target: the system app can act as a **dropper**, while insecure OEM partitions can turn **ADB over TCP** into a repeatable root backdoor.
- If ADB TCP is exposed, review [5555 Android Debug Bridge](../../network-services-pentesting/5555-android-debug-bridge.md) because a writable OEM property file can upgrade an unauthenticated `shell` session into full root after reboot.
148
+
149
+
Boot-time property injection pattern:
150
+
- If `/oem/customer.prop` is writable and imported during boot, adding:
151
+
-`ro.debuggable=1`
152
+
-`service.adb.root=1`
153
+
-`ro.secure=0`
154
+
- then rebooting can make `adb root` succeed on otherwise production-looking devices:
- A preinstalled package with `sharedUserId=android.uid.system` or powerful permissions such as `INSTALL_PACKAGES`, `WRITE_SECURE_SETTINGS`, `CLEAR_APP_USER_DATA`, or `MANAGE_EXTERNAL_STORAGE` can silently behave as a **manifest-driven dropper**.
166
+
- Typical flow:
167
+
1.`BootReceiver` or similar autostart component polls a vendor endpoint.
168
+
2. The server returns JSON metadata such as `pkg`, encrypted `path`, `md5`, `launchType`, `launchParam`, `isShow`, and `reverseLen`.
169
+
3. The app downloads a disguised payload container (`.bpp`, fake media, encrypted blob).
170
+
4. A local unpacking routine restores the real APK/DEX.
171
+
5. Integrity is checked.
172
+
6. Installation happens with `pm install -r` or PackageManager APIs.
173
+
7. A service/activity from `launchParam` is started for persistence.
- Boot receivers and exported foreground services with no launcher icon
178
+
-`usesCleartextTraffic=true`, hidden packages (`isShow=false`), and CDN paths derived from device identifiers
179
+
-`sharedUserId=android.uid.system` or platform-signed system APKs inside `/system`, `/product`, `/vendor`, or `/oem`
180
+
181
+
### C2-controlled anti-analysis for Android payload delivery
182
+
183
+
OEM droppers sometimes make the network artifact intentionally non-parsable unless you recover a **server-supplied transform parameter** from the C2 manifest.
184
+
185
+
-**Byte-reversal packer**: the first `reverseLen` bytes of the downloaded file are reversed before verification/install, so the `.bpp` or `.apk` looks corrupt until you undo the same transformation.
186
+
-**AES-CBC path concealment**: the download path/URL can be encrypted in JSON and derived from a device/channel identifier, so intercepted traffic does not immediately reveal the CDN location.
187
+
188
+
This creates a useful workflow for analysts:
189
+
1. Capture the manifest response over HTTP(S) or instrument the client.
190
+
2. Extract `reverseLen`, `md5`, and the encrypted `path`.
191
+
3. Reproduce any key/IV derivation from `chanId`/channel/build properties.
192
+
4. Decrypt the CDN path.
193
+
5. Undo the byte transformation before feeding the sample to `jadx`, `apktool`, `file`, or DEX parsers.
0 commit comments