- action: report
metadata:
author: Josh Strickland
description: >-
Detects potential ClickFix attack where explorer.exe spawns PowerShell
variants, scripting engines, or LOLBins with suspicious command arguments
via Run dialog (Win+R). Covers multiple PowerShell versions, common
Living off the Land binaries abused in ClickFix campaigns.
falsepositives:
- Legitimate administrative PowerShell scripts launched via Run dialog
- IT management tools using encoded commands
- Software deployment using msiexec or bitsadmin
- Web developers testing scripts with mshta or rundll32
- System administrators using certutil for certificate management
level: high
references:
- https://blog.sekoia.io/clickfix-tactic-the-phantom-meet/
- https://detect.fyi/hunting-clickfix-initial-access-techniques-8c1b38d5ef9b
- https://lolbas-project.github.io/
tags:
- attack.initial_access
- attack.t1204.002
- attack.execution
- attack.t1059.001
- attack.t1059.003
- attack.t1059.005
- attack.t1059.007
- attack.defense_evasion
- attack.t1218
name: Potential ClickFix Chain
event: NEW_PROCESS
op: and
rules:
- op: is windows
- case sensitive: false
op: ends with
path: event/PARENT/FILE_PATH
value: explorer.exe
- op: or
rules:
- { op: ends with, path: event/FILE_PATH, value: powershell.exe }
- { op: ends with, path: event/FILE_PATH, value: pwsh.exe }
- { op: ends with, path: event/FILE_PATH, value: cmd.exe }
- { op: ends with, path: event/FILE_PATH, value: wscript.exe }
- { op: ends with, path: event/FILE_PATH, value: cscript.exe }
- { op: ends with, path: event/FILE_PATH, value: mshta.exe }
- { op: ends with, path: event/FILE_PATH, value: certutil.exe }
- { op: ends with, path: event/FILE_PATH, value: bitsadmin.exe }
- { op: ends with, path: event/FILE_PATH, value: rundll32.exe }
- { op: ends with, path: event/FILE_PATH, value: regsvr32.exe }
- { op: ends with, path: event/FILE_PATH, value: msiexec.exe }
- { op: ends with, path: event/FILE_PATH, value: regasm.exe }
- { op: ends with, path: event/FILE_PATH, value: msbuild.exe }
- { op: ends with, path: event/FILE_PATH, value: wmic.exe }
- not: true
op: or
rules:
- { op: starts with, path: event/COMMAND_LINE, value: '"C:\Program Files\' }
- { op: starts with, path: event/COMMAND_LINE, value: '"C:\Program Files (x86)\' }
- { op: starts with, path: event/COMMAND_LINE, value: 'C:\Program Files\' }
- { op: starts with, path: event/COMMAND_LINE, value: 'C:\Program Files (x86)\' }
- op: or
rules:
- op: matches
path: event/COMMAND_LINE
re: >-
.*\s-e(nc|nco|ncod|ncode|ncoded|ncodedC|ncodedCo|ncodedCom|
ncodedComm|ncodedComma|ncodedComman|ncodedCommand)
\s+[A-Za-z0-9+/=]{50,}.*
- { op: matches, path: event/COMMAND_LINE,
re: '.*(downloadstring|downloadfile).*\|.*(iex|invoke-expression).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*(invoke-webrequest|iwr|wget|curl).*\|.*(iex|invoke-expression).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*net\.webclient.*\.(downloadstring|downloadfile).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*(-w hidden|-windowstyle hidden).*(http|downloadstring).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*bypass.*(http|downloadstring|downloadfile|iex).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*certutil.*-urlcache.*(http|ftp).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*certutil.*-decode.*\.(exe|dll|bat|ps1|vbs).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*bitsadmin.*/transfer.*(http|ftp).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*mshta.*(http|javascript:|vbscript:).*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*rundll32.*javascript:.*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*rundll32.*,.*http.*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*regsvr32.*/s\s+/u\s+/i:http.*scrobj\.dll.*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*wmic.*process call create.*http.*' }
- { op: matches, path: event/COMMAND_LINE,
re: '.*(\\temp\\|\\downloads\\|\\appdata\\local\\temp\\).*\.(exe|bat|cmd|ps1|vbs).*' }
Fibratus detection by
Nedim Šabić — inspired the LimaCharlie version above
name: Potential ClickFix infection chain
id: ffe1fc54-2893-4760-ab50-51a83bd71d13
version: 2.0.1
description: |
Identifies the execution of the process via the Run command dialog box,
Windows Console shortcut, or Explorer address bar followed by spawning
of the potential infostealer process. This could be indicative of the
ClickFix deceptive tactic used by attackers to lure victims into
executing malicious commands under the guise of meeting pages or CAPTCHAs.
labels:
tactic.id: TA0001
tactic.name: Initial Access
technique.id: T1566
technique.name: Phishing
references:
- https://blog.sekoia.io/clickfix-tactic-the-phantom-meet/
- https://blog.sekoia.io/clickfix-tactic-revenge-of-detection/
- https://detect.fyi/hunting-clickfix-initial-access-techniques-8c1b38d5ef9b
condition: >
sequence
maxspan 2m
|spawn_process and
ps.parent.name ~= 'explorer.exe' and length(ps.args) >= 2 and
ps.name iin ('cmd.exe', 'powershell.exe', 'pwsh.exe', 'wget.exe',
'curl.exe', 'msiexec.exe', 'mshta.exe', 'wscript.exe',
'cscript.exe', 'msbuild.exe') and
(thread.callstack.summary imatches
('ntdll.dll|KernelBase.dll|kernel32.dll|windows.storage.dll|shell32.dll|user32.dll|shell32.dll|explorer.exe|SHCore.dll|*',
'ntdll.dll|KernelBase.dll|kernel32.dll|windows.storage.dll|shell32.dll|windows.storage.dll|shell32.dll|user32.dll|shell32.dll|explorer.exe|SHCore.dll|*',
'ntdll.dll|KernelBase.dll|kernel32.dll|windows.storage.dll|shell32.dll|windows.storage.dll|SHCore.dll|*')
or
(thread.callstack.summary imatches '*shell32.dll|explorer.exe|*'
and thread.callstack.symbols imatches '*shell32.dll!GetFileNameFromBrowse*'))
| by ps.uuid
|spawn_process and ps.exe not imatches
('?:\Program Files\*.exe',
'?:\Program Files (x86)\*.exe')
| by ps.parent.uuid
action:
- name: kill
output: >
Potential infostealer process %2.ps.exe delivered via ClickFix infection chain
severity: high
min-engine-version: 3.0.0