Audience: Operators, security researchers, and analysts evaluating threat models, transport security, forensic footprints, and attack surface mitigations on target deployments.
- JWT Rotated HttpOnly Cookies: C2 authentication issues dual HttpOnly cookies:
access_token(5-minute expiration) signed withACCESS_SECRET.refresh_token(7-day expiration) signed withREFRESH_SECRET, bound topath: '/api/auth/rotate'.
- Single-Use Token Rotation & Breach Detection: Every refresh token includes a unique
jtiandfamilyId. When rotated at/api/auth/rotate, the server invalidates the old token. If a previously used refresh token is presented, Breach Detection triggers—nuking all tokens in thatfamilyIdand invalidating the entire operator session. - Brute-Force & Timing Attack Mitigation:
express-rate-limitenforces a 5-attempt limit per 15-minute window on/api/auth/login.bcrypt.compareexecutes against a dummy hash on invalid attempts to eliminate timing side-channel leaks.app.set('trust proxy', 1)enables accurate client IP tracking behind Render / reverse proxies.
- SameSite & Transport Security: Configured with
SameSite=None(withSecure: true) in production for cross-site Render deployments, orSameSite=Laxfor custom domains. - PBKDF2/SHA-256 On-Device Verification: Passwords are authenticated on-device using PBKDF2 with SHA-256 hashing (
PasswordHasher.java). - Configurable Master Key: While
admin1337is the default initial key for fresh installations, setting a custom C2 password (via environment variableC2_PASSWORDor C2 Dashboard) permanently revokesadmin1337. - Emergency Password Reset: Dialing the emergency secret code (
*#7287#) viaTelephonyState.javaallows local recovery by resetting the access key back to default. - Cache-Busting Resources: CSS and JS dashboard assets append dynamic timestamp queries (
style.css?v=${Date.now()}) to prevent stale browser session state exploits.
Security Mitigation: Always set a strong custom
C2_PASSWORD,ACCESS_SECRET, andREFRESH_SECRETin.envor deployment variables.
- DeviceAdminReceiver Policy (
StabilityPolicy.java): Implements an activeDeviceAdminReceiverregistered viares/xml/device_admin.xml. - Admin Elevation Trigger (
elevateAdmin): Operators can remotely trigger Device Admin elevation via the Ghost tab. - Prevention of Force-Stop / Task Killing:
- Recent Apps & Task Manager Shield: Elevating privileges to Device Admin level prevents the application from being stopped or killed when swiped away in the Recent Apps screen or cleared by task-killer managers.
- Settings Force-Stop Lock: Disables the OS-level "Force Stop" and "Uninstall" controls inside Settings → Apps.
- Remote Instant Screen Lock: Allows instant hardware screen locking via
DevicePolicyManager. - Emergency Remote Wipe: Grants permission for remote factory wipe/purge if deployed.
- Direct Mode Exposure: In direct IPv6/IPv4 mode without a relay, traffic runs unencrypted on port
9191. Basic authentication headers use reverse-base64 client-side obfuscation. - C2 Relay TLS Termination: When connected via Webhook or Render C2 Relay tunnels (
server.js), all operator-to-relay traffic is encrypted over HTTPS / TLS. - Base64 Frame Polling: Video feeds (
/camera/frame&/ghost/screenshot) poll JPEG buffers as Base64 Data URIs over HTTP/200 OK responses, avoiding unauthenticated WebSocket or proxy stream injection attacks.
Security Mitigation: Do not expose direct port
9191to untrusted networks without fronting the device with a TLS reverse proxy or using the Render C2 relay.
- Device Configuration Encryption: Local properties (
WEBHOOK_URL,DECOY_CHOICE) are encrypted with build-timeENCRYPTION_KEY. Because the key ships within the APK binary, it protects against casual device inspection, but not static binary reversing. - Exfiltrated Data Vaults: Captured audio (
/audio), photos (/camera), and keylogs (/ghost) are stored in app-private storage (context.getFilesDir()) or public storage if local backup is enabled. - Relay Server Disk: Cloud relay storage (e.g. Render.com) is ephemeral; exfiltrated files stored in
/c2/downloads/should be retrieved immediately.
- Covert Screen Capture: Screenshots taken during Blackout Mode (
screenBrightness = 0.001f) capture the un-dimmed native screen buffer in 720p HD resolution without lighting distortion. - Package Visibility (
<queries>): Implements strict Android 11+ (API 30–36) package visibility declarations inAndroidManifest.xmlforTTS_SERVICEand system intents, preventing OS-level background service blocks. - Keylogger Encryption: Keylogs are encrypted at rest and dynamically decrypted for display, highlighting sensitive patterns (credit cards, PINs, passwords) in red.
- Dependency Cleanliness: Carrier files and assets are generated locally during compilation without third-party remote code execution risks.
- Android SDK Isolation:
apk-builder/build.shauto-configures the local Android SDK path (sdk.dir), enforcing isolated local compilation. - Gradle Network Timeout: Configured with a 120-second timeout (
networkTimeout=120000) to prevent MITM/timeout interruptions during wrapper downloads.
| Tell / Indicator | Risk Level | Mitigation Strategy |
|---|---|---|
Default Package (com.android.system.stability) |
Medium | Change PKG_NAME in build_config.txt / build.sh |
Default Developer Signer (CN=Lab-RATS) |
High | Generate a unique custom keystore per campaign |
| Device Admin & Accessibility Entry | Medium | Unavoidable — required for anti-kill & remote UI control |
| Persistent Service Notification | Low | Minimized to IMPORTANCE_MIN (silent / no sound) |
Listening Port (9191) |
Medium | Customize PORT constant in Constants.java |
- Factory Reset: Wiped if the target device undergoes a factory reset.
- Non-Root Execution: Runs within standard Android app process boundaries. Privileged operations (priv-app installation, system binary execution) require AOSP integration or
PrivilegedInstaller. - Manual User Discovery: Users navigating manually to Settings → Apps → Special App Access can view active Device Admin and Accessibility permissions.