Detection rules › Elastic
Payload Decoded via CertUtil
Identifies when attempts to decode file or information using the Microsoft built-in CertUtil utility. malware droppers may leverage this technique to deobfuscate embedded malicious resources.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies when attempts to decode file or information using the Microsoft built-in CertUtil utility. malware droppers
may leverage this technique to deobfuscate embedded malicious resources.
"""
id = "dbc72ac5-a004-45de-916d-e8aac82c4789"
license = "Elastic License v2"
name = "Payload Decoded via CertUtil"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Certutil/"]
version = "1.0.5"
query = '''
process where event.action == "start" and
(process.name : "certutil.exe" or process.pe.original_file_name == "CertUtil.exe") and
process.args : ("-decode", "-decodehex") and
not (user.id : "S-1-5-18" and process.args : "-decode" and
process.parent.args : "?:\\ProgramData\\CentraStage\\AEMAgent\\Temp\\*.bat") and
not (user.id : "S-1-5-18" and process.command_line : "certutil -decode getSignatureInfo.base64 getSignatureInfo.ps1 ") and
not process.command_line :
("certutil -f -decode C:\\WINDOWS\\Temp\\csat\\csat_dwnldr.txt C:\\WINDOWS\\Temp\\csat\\csat_dwnldr.exe",
"certutil -decode \"c:\\HVworking\\checkSignature.base64\" \"c:\\HVworking\\checkSignature.bat\"")
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
(process.name : "certutil.exe" or process.pe.original_file_name == "CertUtil.exe") and
process.args : ("-decode", "-decodehex") and
not (user.id : "S-1-5-18" and process.args : "-decode" and
process.parent.args : "?:\\ProgramData\\CentraStage\\AEMAgent\\Temp\\*.bat") and
not (user.id : "S-1-5-18" and process.command_line : "certutil -decode getSignatureInfo.base64 getSignatureInfo.ps1 ") and
not process.command_line :
("certutil -f -decode C:\\WINDOWS\\Temp\\csat\\csat_dwnldr.txt C:\\WINDOWS\\Temp\\csat\\csat_dwnldr.exe",
"certutil -decode \"c:\\HVworking\\checkSignature.base64\" \"c:\\HVworking\\checkSignature.bat\"")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | -decode | excludes:process.args field:"process.args" value:"-decode" |
process.parent.args | wildcard | ?:\ProgramData\CentraStage\AEMAgent\Temp\*.bat | excludes:process.parent.args field:"process.parent.args" value:"?:\ProgramData\CentraStage\AEMAgent\Temp\*.bat" |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
process.command_line | eq | certutil -decode getSignatureInfo.base64 getSignatureInfo.ps1 | excludes:process.command_line field:"process.command_line" value:"certutil -decode getSignatureInfo.base64 getSignatureInfo.ps1 " |
process.command_line | eq | certutil -f -decode C:\WINDOWS\Temp\csat\csat_dwnldr.txt C:\WINDOWS\Temp\csat\csat_dwnldr.exe, certutil -decode "c:\HVworking\checkSignature.base64" "c:\HVworking\checkSignature.bat" | excludes:process.command_line |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"certutil.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"CertUtil.exe" |