RatHat is a novel Android malware linked to China-based threat actors that uses smishing, malvertising, Accessibility abuse, and local ADB self-pairing to gain shell-level control and persist on devices. It steals banking and payment credentials, OTP/2FA codes, and lock-screen secrets while using AI-driven automation, covert tunnels, and self-restoring persistence to maintain access. #RatHat #Zimperium #AccessibilityService #ADB #frpc
Keypoints
- RatHat is a new Android malware family associated with threat actors that appear to operate in China.
- It is distributed mainly through smishing, malvertising, and deceptive third-party download portals that deliver malicious APKs.
- The malware abuses Accessibility services and local ADB wireless debugging pairing to escape the app sandbox and gain shell-level privileges.
- RatHat steals banking and payment credentials, intercepts OTP/2FA codes, and can reconstruct PINs and passwords from raw touch input.
- It uses generative AI to automate UI navigation and device interaction in real time, making behavior more adaptive and harder to detect.
- Persistence is achieved through a hidden background service, auto-reinstallation, and a separate privileged Go agent that survives app removal.
- RatHat also maintains covert C2 access through a reverse-proxy client that exposes internal device services over a persistent tunnel.
MITRE Techniques
- [T1566.001 ] Spearphishing Attachment â Delivered through targeted smishing and deceptive phishing lures sent via SMS/text messages (âdistributed primarily via targeted smishing (SMS/text phishing)â)
- [T1189 ] Drive-by Compromise â Users are lured through malvertising to deceptive third-party download portals (âmalvertising campaigns leading to deceptive third-party download portalsâ)
- [T1204.002 ] Malicious File â Delivered via user-downloaded malicious APKs that appear legitimate (âmanually downloading malicious APKs that appear to be legitimate appsâ)
- [T1620 ] Reflective Code Loading â Loads an in-memory DEX by reflection to unpack and install the payload (âstage 2 is an in-memory DEX loaded by reflectionâ)
- [T1112 ] Modify Registry â Modifies Android settings to enable accessibility and debugging features (âsettings put secure enabled_accessibility_servicesâ and âsettings put secure accessibility_enabled 1â)
- [T1548.001 ] Abuse Elevation Control Mechanism: Setuid and Setgid â Exploits SessionInstaller APIs and ADB pairing to bypass restricted settings and gain elevated execution (âbypass Androidâs restricted settingsâ and âsecuring shell-level accessâ)
- [T1614 ] Hide Artifacts â Uses container tampering, manifest bombs, and poisoned DEX to break analysis tools (âdeclaring some files as directoriesâ, âAndroidManifest.xml file is of 61MBâ, âDEX Bytecode Poisoningâ)
- [T1497.001 ] Virtualization/Sandbox Evasion: System Checks â Checks for emulator, root, Xposed, and debuggable properties (âXposed, root or emulator checksâ and âProperties checkâ)
- [T1622 ] Debugger Evasion â Uses JDWP, ptrace, Frida, and FLAG_DEBUGGABLE checks to avoid analysis (âJDWP debugger checkâ, âPtrace attach checkâ, âFrida Checkâ)
- [T1016 ] System Network Configuration Discovery â Collects wireless debugging port and ADB pairing details from the UI (âscrape critical connection dataâ and âthe 6-digit ADB Pairing Code and the dynamic portâ)
- [T1056.001 ] Input Capture: Keylogging â Reconstructs typed text from Accessibility events and raw input events (âtrack beforeText, eventTextâŚâ and âgeteventâ)
- [T1185 ] Browser Session Cookie / URL Harvesting â Reads browser address bars from multiple browsers to capture web activity (âReads address bars by resource IDâ)
- [T1113 ] Screen Capture â Uses MediaProjection and screen-monitoring tooling to capture the screen (âMediaProjection Screen streamingâ and âscreen-capture toolingâ)
- [T1056.003 ] Input Capture: Clipboard Data â Intercepts OTP/2FA and form data via notification/SMS collection and overlays (âintercept 2FA/OTP codesâ and âoverlay form submissionsâ)
- [T1543.003 ] Create or Modify System Process: Windows Service â Establishes hidden background services and native daemons that persist outside the app lifecycle (âhidden background serviceâ and âstaging independent native daemonsâ)
- [T1098 ] Account Manipulation â Requests Device Admin rights and grants itself permissions and persistence controls (ârequest Device Admin rightsâ and âgrant the application persistent operationâ)
- [T1090.001 ] Proxy: Internal Proxy â Uses FRP to expose loopback services and device interfaces through a reverse tunnel (âestablish a secure, persistent reverse tunnel back to the C2 serverâ)
- [T1071.001 ] Application Layer Protocol: Web Protocols â Communicates with C2 over HTTP, WebSocket, and local loopback HTTP services (âregisters over HTTPâ, âholds a WebSocket openâ, âHTTP server bound to 127.0.0.1:7910â)
- [T1105 ] Ingress Tool Transfer â Stages and launches additional components such as the Go agent and FRP client (âstage and launch both the Go Agent and the FRP Clientâ)
Indicators of Compromise
- [File names ] Disguised payloads and staged components â liblocal-service.so, libmedia_codec.so
- [File paths ] Local staging and persistence locations â /data/local/tmp, /data/local/tmp/app.apk
- [URLs / API endpoints ] C2 and telemetry channels â /api/node/register, /api/v2/dev/tasks?deviceId=%s
- [IP addresses ] Local host binding used by the Go agent â 127.0.0.1, 127.0.0.1:7910
- [Ports ] Debugging and service ports â 27042, dynamic ADB pairing port
- [Android package names ] Targeted apps and detection strings â com.android.chrome:id/url_bar, com.sec.android.app.sbrowser:id/location_bar_edit_text
- [Configuration / artifact names ] Malicious configs and support files â server_config.json, svc_config.html, locateValues.json
- [Libraries / tooling names ] Embedded components and proxy tooling â libadb-android, frpc, minicap