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
title: Encoded payload file decoded by certutil or PowerShellid: 2930f671-270e-44a8-823b-26eaf016f0a3status: experimentaldescription: | 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.references: - https://attack.mitre.org/techniques/T1027/013 - https://attack.mitre.org/detectionstrategies/DET0087author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags: - attack.defense-evasion - attack.t1027.013logsource: category: process_creation product: windowsdetection: selection_certutil: Image|endswith: '\certutil.exe' CommandLine|contains|windash: - '-decode' - '-decodehex' selection_ps_image: Image|endswith: - '\powershell.exe' - '\pwsh.exe' selection_ps_decode: CommandLine|contains: - 'FromBase64String' - 'FromBase64Transform' - 'CreateDecryptor' - 'GzipStream' selection_ps_file: CommandLine|contains: - 'Get-Content' - 'ReadAllBytes' - 'ReadAllText' - 'OpenRead' condition: selection_certutil or (selection_ps_image and selection_ps_decode and selection_ps_file)falsepositives: - "Administrators and installer scripts using certutil -decode for its documented purpose, converting a Base64-armoured .cer or .pem certificate back to binary DER before importing it — the single most common legitimate reason that flag is ever typed." - "Deployment and endpoint-management tooling — an Intune or SCCM remediation script, a CI build agent, or a bootstrap script — that stores a certificate, licence blob or configuration file Base64-encoded and reads it back with Get-Content piped into FromBase64String." - "PowerShell modules and log-processing scripts that open a .gz artefact with GzipStream after reading it from disk, which satisfies the decode and file halves of the PowerShell branch without any obfuscation being involved."level: mediumSentinel · 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.