Stealth in Layers: Unmasking the Loader used in Targeted Email Campaigns
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
A widely available loader is being repurposed by multiple threat actors to deliver different RATs and information stealers through phishing emails carrying weaponized JavaScript, PowerShell, LNK, and ZIP attachments. The loader combines steganography, reflective loading, process hollowing, and an emerging UAC-bypass method to enable fileless execution and elevate privileges. Activity has been observed targeting manufacturing and government entities across Europe and the Middle East, with the apparent goal of stealing industrial data and credentials.
Investigation
Cyble Research and Intelligence Labs analyzed the delivery chain and outlined a four-stage evasion workflow. It begins with an obfuscated JavaScript stager, pivots to a PowerShell steganographic loader, abuses a trojanized TaskScheduler library, and culminates in payload injection into RegAsm.exe. The end-stage malware is PureLog Stealer, which collects browser credentials, cryptocurrency wallet data, and host/system information for exfiltration.
Mitigation
Use advanced email protections with sandbox detonation, block script execution from email-delivered content, enforce PowerShell Constrained Language Mode, and monitor for hollowing of legitimate Windows binaries. Add detection for steganography in image files and tune EDR rules to surface reflective .NET assembly loading and UAC-bypass patterns associated with this loader chain.
Response
If indicators appear, isolate the endpoint, stop suspicious PowerShell and WMI activity, capture memory images, and hunt for reflective .NET artifacts and injected RegAsm.exe processes. Reset potentially exposed credentials and block the associated malicious domains and IP addresses to prevent reinfection and lateral activity.
"graph TB %% Class definitions classDef action fill:#99ccff %% Node definitions act_phishing["<b>Action</b> – <b>T1566.001 Phishing Attachment</b><br/><b>Description</b>: Send malicious email attachment that exploits Office vulnerability."] class act_phishing action act_exploit["<b>Action</b> – <b>T1203 Exploitation for Client Execution</b> (CVEu20112017u201111882)<br/><b>Description</b>: Trigger vulnerability in Microsoft Office to execute code."] class act_exploit action act_obfuscate["<b>Action</b> – <b>T1027 Obfuscated Files or Information</b><br/><b>Description</b>: Load obfuscated JavaScript or PowerShell to hide malicious intent."] class act_obfuscate action act_stego["<b>Action</b> – <b>T1027.003 Steganography</b><br/><b>Description</b>: Embed payload inside PNG image to evade detection."] class act_stego action act_reflective_load["<b>Action</b> – <b>T1620 Reflective Code Loading</b><br/><b>Description</b>: Load .NET assembly in memory without touching disk."] class act_reflective_load action act_regasm["<b>Action</b> – <b>T1218.009 RegAsm Proxy Execution</b><br/><b>Description</b>: Abuse RegAsm to execute arbitrary .NET code."] class act_regasm action act_process_hollow["<b>Action</b> – <b>T1055.012 Process Hollowing</b><br/><b>Description</b>: Replace legitimate process memory with malicious code."] class act_process_hollow action act_uac_bypass["<b>Action</b> – <b>T1548.002 Bypass User Account Control</b><br/><b>Description</b>: Elevate privileges without prompting user."] class act_uac_bypass action act_cred_steal["<b>Action</b> – <b>T1555.003 Credentials from Web Browsers</b><br/><b>Description</b>: Dump saved browser credentials."] class act_cred_steal action act_data_collect["<b>Action</b> – <b>T1119 Automated Collection</b><br/><b>Description</b>: Gather files and system information."] class act_data_collect action act_exfil["<b>Action</b> – <b>T1102 Exfiltration Over Web Service</b> / <b>T1041 Exfiltration Over C2 Channel</b><br/><b>Description</b>: Send collected data to remote server via web service."] class act_exfil action %% Connections act_phishing –>|leads_to| act_exploit act_exploit –>|leads_to| act_obfuscate act_obfuscate –>|leads_to| act_stego act_stego –>|leads_to| act_reflective_load act_reflective_load –>|leads_to| act_regasm act_regasm –>|leads_to| act_process_hollow act_process_hollow –>|leads_to| act_uac_bypass act_uac_bypass –>|leads_to| act_cred_steal act_cred_steal –>|leads_to| act_data_collect act_data_collect –>|leads_to| act_exfil "
Attack Flow
Detections
LOLBAS WScript / CScript (via process_creation)
View
Image File Was Created By Suspicious Process (via file_event)
View
Suspicious Powershell Strings (via powershell)
View
Possible Internet Archive Resolved By Uncommon Process (via dns_query)
View
Call Suspicious .NET Methods from Powershell (via powershell)
View
Suspicious File Download Direct IP (via proxy)
View
IOCs (SourceIP) to detect: Stealth in Layers: Unmasking the Loader used in Targeted Email Campaigns
View
IOCs (DestinationIP) to detect: Stealth in Layers: Unmasking the Loader used in Targeted Email Campaigns
View
IOCs (HashSha256) to detect: Stealth in Layers: Unmasking the Loader used in Targeted Email Campaigns
View
Hidden PowerShell and Base64 Decoded Script Detection [Windows Powershell]
View
WMI Object Creation and Process Hollowing Detection [Windows Process Creation]
View
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.
-
Attack Narrative & Commands:
An adversary sends a spear‑phishing email containing a JPEG attachment with a hidden PowerShell payload steganographically embedded. After the victim opens the attachment, the attacker’s first‑stage script extracts the hidden data, decodes it from Base64, and launches a second‑stage PowerShell loader in a hidden window. The loader subsequently contacts a C2 server to download additional tools. The exact command line generated on the victim host is:powershell -WindowStyle Hidden -EncodedCommand <Base64String>Because the attacker explicitly includes the word “Base64” in the script (e.g., by using the
-EncodedCommandwrapper that prints “Base64” in comments), the detection rule’sselection_base64_decoded_scriptcondition matches, and the hidden window flag satisfiesselection_hidden_powershell. -
Regression Test Script:
# Hidden PowerShell Base64 loader simulation # ------------------------------------------------- # Step 1: Craft a dummy PowerShell script $script = 'Write-Host "Compromised host: $env:COMPUTERNAME"; Start-Sleep -Seconds 30' # Step 2: Encode to Base64 (Unicode) $bytes = [System.Text.Encoding]::Unicode.GetBytes($script) $b64 = [Convert]::ToBase64String($bytes) # Step 3: Launch hidden PowerShell with the encoded payload Start-Process -FilePath "powershell.exe" ` -ArgumentList "-WindowStyle Hidden -EncodedCommand $b64" ` -WindowStyle Hidden ` -NoNewWindow # The presence of the string "Base64" in the comment satisfies the rule. -
Cleanup Commands:
# Terminate any lingering hidden PowerShell instances started by the test Get-Process -Name "powershell" | Where-Object { $_.StartInfo.Arguments -match "-WindowStyle Hidden" } | Stop-Process -Force # Optional: Remove any temporary files (none created in this script)