Encoded payload file decoded by certutil or PowerShell
Matches the on-disk half of AN0237 — a command line that reads an encoded or encrypted file and converts it back to its original bytes. Two shapes are covered: certutil's -decode / -decodehex, which takes an encoded file in and writes a decoded file out, and a PowerShell invocation that combines a file-read call with a Base64 or symmetric-decryption call in the same line. The PowerShell branch requires both halves rather than either alone, because FromBase64String on its own is an inline-string decode belonging to T1027.010, whereas T1027.013 is specifically about an encoded *file*. The brief maps Security 4688 onto the process_creation category; this rule is written in the Sysmon process_creation vocabulary (Image, CommandLine), so a 4688 feed needs a field mapping — NewProcessName to Image, ParentProcessName to ParentImage — before it can match at all. 4688 also needs Audit Process Creation enabled plus the separate Include command line in process creation events policy; neither is on by default nor in the CIS baseline, and without the command-line policy every event arrives with an empty CommandLine and this rule silently matches nothing. AN0237's image_load and process_access legs, which cover the in-memory unpack that leaves no command-line trace, are not expressible as a single event and are not attempted here. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0087, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceProcessEvents| where ((FolderPath endswith "\\certutil.exe" and (ProcessCommandLine contains "-decode" or ProcessCommandLine contains "/decode" or ProcessCommandLine contains "–decode" or ProcessCommandLine contains "—decode" or ProcessCommandLine contains "―decode" or ProcessCommandLine contains "-decodehex" or ProcessCommandLine contains "/decodehex" or ProcessCommandLine contains "–decodehex" or ProcessCommandLine contains "—decodehex" or ProcessCommandLine contains "―decodehex")) or (((FolderPath endswith "\\powershell.exe" or FolderPath endswith "\\pwsh.exe") and (ProcessCommandLine contains "FromBase64String" or ProcessCommandLine contains "FromBase64Transform" or ProcessCommandLine contains "CreateDecryptor" or ProcessCommandLine contains "GzipStream")) and (ProcessCommandLine contains "Get-Content" or ProcessCommandLine contains "ReadAllBytes" or ProcessCommandLine contains "ReadAllText" or ProcessCommandLine contains "OpenRead")))
Splunk · SPL
Run this as a search.
index=* ((Image="*\\certutil.exe" AND (CommandLine="*-decode*" OR CommandLine="*/decode*" OR CommandLine="*–decode*" OR CommandLine="*—decode*" OR CommandLine="*―decode*" OR CommandLine="*-decodehex*" OR CommandLine="*/decodehex*" OR CommandLine="*–decodehex*" OR CommandLine="*—decodehex*" OR CommandLine="*―decodehex*")) OR (((Image="*\\powershell.exe" OR Image="*\\pwsh.exe") AND (CommandLine="*FromBase64String*" OR CommandLine="*FromBase64Transform*" OR CommandLine="*CreateDecryptor*" OR CommandLine="*GzipStream*")) AND (CommandLine="*Get-Content*" OR CommandLine="*ReadAllBytes*" OR CommandLine="*ReadAllText*" OR CommandLine="*OpenRead*")))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*\\\\certutil.exe" AND (TO_LOWER(process.command_line) LIKE "*-decode*" OR TO_LOWER(process.command_line) LIKE "*/decode*" OR TO_LOWER(process.command_line) LIKE "*–decode*" OR TO_LOWER(process.command_line) LIKE "*—decode*" OR TO_LOWER(process.command_line) LIKE "*―decode*" OR TO_LOWER(process.command_line) LIKE "*-decodehex*" OR TO_LOWER(process.command_line) LIKE "*/decodehex*" OR TO_LOWER(process.command_line) LIKE "*–decodehex*" OR TO_LOWER(process.command_line) LIKE "*—decodehex*" OR TO_LOWER(process.command_line) LIKE "*―decodehex*")) OR (((TO_LOWER(process.executable) LIKE "*\\\\powershell.exe" OR TO_LOWER(process.executable) LIKE "*\\\\pwsh.exe") AND (TO_LOWER(process.command_line) LIKE "*frombase64string*" OR TO_LOWER(process.command_line) LIKE "*frombase64transform*" OR TO_LOWER(process.command_line) LIKE "*createdecryptor*" OR TO_LOWER(process.command_line) LIKE "*gzipstream*")) AND (TO_LOWER(process.command_line) LIKE "*get-content*" OR TO_LOWER(process.command_line) LIKE "*readallbytes*" OR TO_LOWER(process.command_line) LIKE "*readalltext*" OR TO_LOWER(process.command_line) LIKE "*openread*")))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <!-- 2 rules: the Sigma condition ORs across different fields, which one rule cannot express. Any one matching is a hit. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)\\certutil\.exe$</field> <field name="CommandLine" type="pcre2">(?i)(-decode|/decode|–decode|—decode|―decode|-decodehex|/decodehex|–decodehex|—decodehex|―decodehex)</field> <description>Encoded payload file decoded by certutil or PowerShell (1/2)</description> <mitre> <id>T1027.013</id> </mitre> </rule> <rule id="100001" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\powershell\.exe$|\\pwsh\.exe$)</field> <field name="CommandLine" type="pcre2">(?i)(FromBase64String|FromBase64Transform|CreateDecryptor|GzipStream)</field> <field name="CommandLine" type="pcre2">(?i)(Get-Content|ReadAllBytes|ReadAllText|OpenRead)</field> <description>Encoded payload file decoded by certutil or PowerShell (2/2)</description> <mitre> <id>T1027.013</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.