DEV Community

Anoymask
Anoymask

Posted on Edited on

TZRat: Abuses Wireless ADB and scrcpy to Secretly Stream Android Screens

1. Basic Information

2. Summary in One Sentence

ESET detected activity of the Android RAT "TZRat" on devices in Romania and the United Arab Emirates. Sample analysis confirmed capabilities to automate wireless ADB pairing via Accessibility Service and relay the screen using scrcpy without displaying standard screen-sharing dialogs or cast icons.

3. Attack Flow

TZRat masquerades as Chrome. According to ESET, it is not distributed on Google Play, and the initial distribution vector is unknown. After launch, it prompts the user to enable Accessibility Service. Once Accessibility Service is enabled, it attempts wireless ADB pairing behind a fake system update screen.

When Wireless ADB Pairing Succeeds

  • If wireless ADB pairing succeeds, it can relay the screen to the C2 using scrcpy. Normal screen-sharing permission dialogs or cast icons are not displayed.

When Wireless ADB Pairing Fails

  • If wireless ADB pairing fails, TZRat switches to a path that uses standard Android MediaProjection. MediaProjection displays a standard dialog requesting consent for screen sharing. ESET's public report does not explain whether TZRat can obtain consent on this path, or how it does so.

Related Capabilities

The sample supports over 100 commands via WebSocket. In the analyzed sample, scrcpy is used solely for screen relaying, while Accessibility Service and the ADB shell are used for remote control of the device.

4. Attacker Location and Execution Context

  • The attacker operates remotely from a C2 management panel. When wireless ADB pairing succeeds, ADB commands are executed with shell user privileges.

5. Visibility from Victim and Administrator Perspectives

Victim

  • The victim sees an app masquerading as Chrome, a display masquerading as Chrome's loading screen, and a fake system update screen. When relaying via scrcpy, normal sharing permission dialogs or cast icons do not appear.

Administrator

  • Clues include the app installation source, granting of Accessibility Service permissions, enabling of Developer Options and wireless debugging, ADB pairing, and WebSocket communications to unknown hosts.

6. Success and Failure Conditions

Success Conditions

  • The malicious app is installed and Accessibility Service is enabled.
  • For the scrcpy path, wireless ADB pairing and scrcpy launch succeed. For the fallback path, a MediaProjection screen-sharing session with standard consent procedures is started.
  • The device can communicate with the C2.

Failure Conditions and Countermeasures

  • Enable Google Play Protect, and on managed devices, restrict installation from unknown sources, Developer Options, wireless debugging, and unapproved Accessibility Services.
  • If infection is suspected, isolate the device from the network and confirm that ADB connections are terminated. Simply disabling wireless debugging settings or unpairing may leave ADB connections separately enabled by TZRat active. Change credentials and device lock information after isolation.
  • ESET has shared known versions with Google, and Play Protect detects known samples on devices with Google Play Services.

7. What Happens Upon Success

  • On the scrcpy path, the screen can be relayed without displaying standard dialogs or indicator icons. Other capabilities are used for remote control of the device.
  • Theft of in-app input, passwords, and unlock credentials such as PINs and 3x3 patterns.
  • Access to the camera, microphone, location, and files, as well as additional operations via arbitrary ADB commands.

8. Observable Logs

  • Proxy / SWG / DNS: Use DNS logs to check for lookups of domains such as the sample's C2 domain. Identifying WebSocket requires logs from proxies or endpoints capable of identifying that protocol. ESET's public IoCs also include destinations observed as management panels. The sample's connection destinations include v3.p9a[.]xyz.
  • Endpoint / EDR: Suspicious APKs on Android devices, packages masquerading as Chrome, Accessibility Service, wireless debugging, ADB pairing, and scrcpy-related files or processes.
  • Identity / IdP: Authentication from unusual locations or devices is a clue for investigation. Authentication logs alone cannot determine credential theft from the device.
  • SaaS / Cloud: Changes to developer settings, sideloading, and Accessibility Service permission status in MDM.
  • Network: Registration communications and WebSocket from the device to the C2, and sustained outbound traffic associated with screen relaying.

9. Attack Success Determination

  • Confirmed malware execution or authentication success: Public information: ESET reported that another TZRat variant had been deployed on devices in Romania and the UAE, stating it was used in the wild. Sample analysis confirmed the screen-relaying capability using wireless ADB and scrcpy, as well as the fallback path using MediaProjection when pairing fails. It has not been publicly disclosed whether screens were relayed on real devices via either path.

10. Investigation Playbook

  • Trigger: Suspicious APK, granting of Accessibility Service permissions, enabling of wireless debugging, WebSocket to an unknown C2.
  • Initial Check: Verify the APK source, package name, signature, installation time, permissions, Accessibility Service, and ADB settings.
  • Endpoint: Preserve the APK, device logs, setting change history, ADB pairing records, scrcpy-related files, and C2 communications.
  • Identity & Cloud: Check authentication history and tokens for accounts handled on the device, and revoke issued sessions or tokens if necessary.
  • Follow-on Actions: Check for screen/input theft, financial app manipulation, camera/microphone usage, and execution of additional APKs or commands.
  • Containment: Isolate the device, confirm termination of ADB connections, use MDM to remove the app or factory-reset the device, and change credentials and device lock information.
  • Classification: Separate installation, permission granting, ADB pairing, screen relaying, credential theft, and subsequent unauthorized use.

11. Defense and Detection Ideas

  • Single Event: Granting Accessibility Service permissions to unapproved apps, enabling wireless debugging, unknown ADB pairing.
  • Timeline Correlation: Correlate installation of suspicious apps, granting of Accessibility Service permissions, changes to developer settings, ADB pairing, and WebSocket communications.
  • Hunting: Search for unofficial APKs with names similar to Chrome, scrcpy artifacts, ESET public IoCs, and managed devices with developer settings enabled.
  • Log Gaps: If MDM does not collect app installation sources, Accessibility Service, and ADB settings, tracking from initial intrusion to screen relaying is difficult.
  • Priority Countermeasures: Prioritize sideloading restrictions, Play Protect, allowlisting for Accessibility Service, disabling ADB, and strong additional authentication for financial and administrative operations.

12. Facts / Inference / Hypothesis

Facts

  • ESET detected TZRat on devices in Romania and the UAE from late September to early October 2026.
  • According to ESET, TZRat was not distributed on Google Play and masqueraded as Chrome. The initial distribution vector is unknown.
  • TZRat uses Accessibility Service to automate the Android UI and attempts wireless ADB pairing behind a fake update screen.
  • Because it uses legitimate scrcpy, it can relay the screen without screen-sharing permission dialogs or cast icons.
  • Based on Chinese text in the code and management panel, ESET assessed with medium confidence that the activity is by Chinese-speaking attackers. This is not an assessment indicating involvement of the Chinese government.
  • Of the 12 TZRat management panels ESET found on Censys, 6 used the same IP address as DarkSword management panels on different ports. The C2 the analyzed samples refer to is only 1 other of the 12 panels, and no evidence supporting a common operator has been found.

Inference

  • Combining ADB with legitimate tools is likely intended to avoid normal screen-sharing indicators and create a state where the victim is less likely to recognize the operation.

Hypothesis

  • None

13. MITRE ATT&CK Mapping

ID Technique Confidence Basis
T1418 Software Discovery high ESET confirmed a capability in the sample to retrieve a list of installed apps.
T1417.001 Input Capture: Keylogging high ESET confirmed a capability in the sample to record app input by abusing Accessibility Service.
T1513 Screen Capture high ESET confirmed a capability in the sample to capture and relay the screen.

14. Unknowns and Further Investigation

  • The initial distribution vector, number of infected devices, and number of financial information thefts or unauthorized uses are unconfirmed.
  • The relationship with DarkSword, organizational attribution of the C2 operators, and any relationship with the Chinese government are unconfirmed.

15. Impact on SOCs and Organizations

Organizations cannot rely solely on app permission prompts for Android malware defense. It is necessary to monitor and restrict sideloading, Accessibility Service, Developer Options, and wireless ADB together via MDM, and combine this with additional verification using device state and authentication risk on the financial and business app side.

16. Summary by Audience

  • For SOC: Correlate unofficial APKs, Accessibility Service, wireless ADB, scrcpy artifacts, and persistent WebSocket in chronological order.
  • For Administrators: Enable Play Protect and MDM controls, and prohibit unnecessary Developer Options, wireless debugging, and Accessibility Service.
  • For Users: Install Chrome from the official store. Stop operations if an app masquerading as Chrome requests Accessibility Service permission, if a screen masquerading as a system update appears, or if developer settings permissions are requested.

Top comments (0)