Detection rule
Suspicious File Downloaded From Direct IP Via Certutil.EXE
Overview
Detects the execution of certutil with certain flags that allow the utility to download files from direct IPs.
- Rule id
13e6fe51-d478-4c7e-b0f2-6da9b400a829- ATT&CK techniques
- T1027 Obfuscated Files or Information, T1105 Ingress Tool Transfer
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, safepay, rhysida, Play, everest, nightspire
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
2 of 2 positive test events matched; 3 of 3 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 13e6fe51-d478-4c7e-b0f2-6da9b400a829
title: Suspicious File Downloaded From Direct IP Via Certutil.EXE
id: 13e6fe51-d478-4c7e-b0f2-6da9b400a829
related:
- id: 19b08b1c-861d-4e75-a1ef-ea0c1baf202b # Direct IP download
type: similar
- id: 42a5f1e7-9603-4f6d-97ae-3f37d130d794 # File sharing download
type: similar
status: test
description: Detects the execution of certutil with certain flags that allow the utility to download files from direct IPs.
references:
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/certutil
- https://forensicitguy.github.io/agenttesla-vba-certutil-download/
- https://news.sophos.com/en-us/2021/04/13/compromised-exchange-server-hosting-cryptojacker-targeting-other-exchange-servers/
- https://twitter.com/egre55/status/1087685529016193025
- https://lolbas-project.github.io/lolbas/Binaries/Certutil/
- https://twitter.com/_JohnHammond/status/1708910264261980634
- https://www.hexacorn.com/blog/2020/08/23/certutil-one-more-gui-lolbin
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-02-15
modified: 2025-12-01
tags:
- attack.stealth
- attack.t1027
- attack.command-and-control
- attack.t1105
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\certutil.exe'
- OriginalFileName: 'CertUtil.exe'
selection_flags:
CommandLine|contains:
- 'urlcache '
- 'verifyctl '
- 'URL '
selection_http:
CommandLine|contains:
- '://1'
- '://2'
- '://3'
- '://4'
- '://5'
- '://6'
- '://7'
- '://8'
- '://9'
# filter_local_ips:
# # Note: Uncomment this filter if you want to exclude local IPs
# CommandLine|contains:
# - '://10.' # 10.0.0.0/8
# - '://192.168.' # 192.168.0.0/16
# - '://172.16.' # 172.16.0.0/12
# - '://172.17.'
# - '://172.18.'
# - '://172.19.'
# - '://172.20.'
# - '://172.21.'
# - '://172.22.'
# - '://172.23.'
# - '://172.24.'
# - '://172.25.'
# - '://172.26.'
# - '://172.27.'
# - '://172.28.'
# - '://172.29.'
# - '://172.30.'
# - '://172.31.'
# - '://127.' # 127.0.0.0/8
# - '://169.254.' # 169.254.0.0/16
filter_main_seven_zip:
CommandLine|contains: '://7-' # For https://7-zip.org/
condition: all of selection_* and not 1 of filter_main_*
falsepositives:
- Unknown
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_certutil_download_direct_ip/info.ymlQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND (((LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\certutil.exe') OR Filename='CertUtil.exe') AND (LOWER(Command) LIKE '%urlcache %' OR LOWER(Command) LIKE '%verifyctl %' OR LOWER(Command) LIKE '%url %') AND (LOWER(Command) LIKE '%://1%' OR LOWER(Command) LIKE '%://2%' OR LOWER(Command) LIKE '%://3%' OR LOWER(Command) LIKE '%://4%' OR LOWER(Command) LIKE '%://5%' OR LOWER(Command) LIKE '%://6%' OR LOWER(Command) LIKE '%://7%' OR LOWER(Command) LIKE '%://8%' OR LOWER(Command) LIKE '%://9%')) AND (NOT(LOWER(Command) LIKE '%://7-%'))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Suspicious File Downloaded From Direct IP Via Certutil.EXE- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_img(match)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.Process Path / Process Nameends with:\certutil.exeFilenameis equal to (case-insensitive):CertUtil.exe
BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_flags(match)All test lines must match (AND).Commandcontains:urlcache,verifyctl,URL
BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_http(match)All test lines must match (AND).Commandcontains:://1,://2,://3,://4,://5,://6,://7,://8,://9
BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:filter_main_seven_zip(exclusion)All test lines must match (AND).Commandcontains:://7-
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
(ALL of [BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_img, BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_flags, BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:selection_http]) AND NOT (ANY of [BB:OffSet7:Suspicious File Downloaded From Direct IP Via Ce:filter_main_seven_zip])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND (((LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\certutil.exe') OR Filename='CertUtil.exe') AND (LOWER(Command) LIKE '%urlcache %' OR LOWER(Command) LIKE '%verifyctl %' OR LOWER(Command) LIKE '%url %') AND (LOWER(Command) LIKE '%://1%' OR LOWER(Command) LIKE '%://2%' OR LOWER(Command) LIKE '%://3%' OR LOWER(Command) LIKE '%://4%' OR LOWER(Command) LIKE '%://5%' OR LOWER(Command) LIKE '%://6%' OR LOWER(Command) LIKE '%://7%' OR LOWER(Command) LIKE '%://8%' OR LOWER(Command) LIKE '%://9%')) AND (NOT(LOWER(Command) LIKE '%://7-%'))
Rule response
- Severity 7, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
(Image="*\\certutil.exe" OR OriginalFileName="CertUtil.exe") (CommandLine IN ("*urlcache *", "*verifyctl *", "*URL *")) (CommandLine IN ("*://1*", "*://2*", "*://3*", "*://4*", "*://5*", "*://6*", "*://7*", "*://8*", "*://9*")) NOT CommandLine="*://7-*"Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Suspicious File Downloaded From Direct IP Via Certutil.EXE]
description = Detects the execution of certutil with certain flags that allow the utility to download files from direct IPs.
search = (Image="*\\certutil.exe" OR OriginalFileName="CertUtil.exe") (CommandLine IN ("*urlcache *", "*verifyctl *", "*URL *")) (CommandLine IN ("*://1*", "*://2*", "*://3*", "*://4*", "*://5*", "*://6*", "*://7*", "*://8*", "*://9*")) NOT CommandLine="*://7-*"Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where ((TargetProcessName endswith "\\certutil.exe" or TargetProcessFileOriginalName =~ "CertUtil.exe") and (TargetProcessCommandLine contains "urlcache " or TargetProcessCommandLine contains "verifyctl " or TargetProcessCommandLine contains "URL ") and (TargetProcessCommandLine contains "://1" or TargetProcessCommandLine contains "://2" or TargetProcessCommandLine contains "://3" or TargetProcessCommandLine contains "://4" or TargetProcessCommandLine contains "://5" or TargetProcessCommandLine contains "://6" or TargetProcessCommandLine contains "://7" or TargetProcessCommandLine contains "://8" or TargetProcessCommandLine contains "://9")) and (not(TargetProcessCommandLine contains "://7-"))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where ((FolderPath endswith "\\certutil.exe" or ProcessVersionInfoOriginalFileName =~ "CertUtil.exe") and (ProcessCommandLine contains "urlcache " or ProcessCommandLine contains "verifyctl " or ProcessCommandLine contains "URL ") and (ProcessCommandLine contains "://1" or ProcessCommandLine contains "://2" or ProcessCommandLine contains "://3" or ProcessCommandLine contains "://4" or ProcessCommandLine contains "://5" or ProcessCommandLine contains "://6" or ProcessCommandLine contains "://7" or ProcessCommandLine contains "://8" or ProcessCommandLine contains "://9")) and (not(ProcessCommandLine contains "://7-"))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
((process.executable:*\\certutil.exe OR process.pe.original_file_name:CertUtil.exe) AND (process.command_line:(*urlcache\ * OR *verifyctl\ * OR *URL\ *)) AND (process.command_line:(*\:\/\/1* OR *\:\/\/2* OR *\:\/\/3* OR *\:\/\/4* OR *\:\/\/5* OR *\:\/\/6* OR *\:\/\/7* OR *\:\/\/8* OR *\:\/\/9*))) AND (NOT process.command_line:*\:\/\/7\-*)Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where ((process.executable:"*\\certutil.exe" or process.pe.original_file_name:"CertUtil.exe") and (process.command_line like~ ("*urlcache *", "*verifyctl *", "*URL *")) and (process.command_line like~ ("*://1*", "*://2*", "*://3*", "*://4*", "*://5*", "*://6*", "*://7*", "*://8*", "*://9*"))) and (not process.command_line:"*://7-*")Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where (ends_with(process.executable, "\\certutil.exe") or process.pe.original_file_name=="CertUtil.exe") and (process.command_line like "*urlcache *" or process.command_line like "*verifyctl *" or process.command_line like "*URL *") and (process.command_line like "*://1*" or process.command_line like "*://2*" or process.command_line like "*://3*" or process.command_line like "*://4*" or process.command_line like "*://5*" or process.command_line like "*://6*" or process.command_line like "*://7*" or process.command_line like "*://8*" or process.command_line like "*://9*") and not process.command_line like "*://7-*"Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageOriginalFileName
False positives
- Unknown
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/certutil
- https://forensicitguy.github.io/agenttesla-vba-certutil-download/
- https://news.sophos.com/en-us/2021/04/13/compromised-exchange-server-hosting-cryptojacker-targeting-other-exchange-servers/
- https://twitter.com/egre55/status/1087685529016193025
- https://lolbas-project.github.io/lolbas/Binaries/Certutil/
- https://twitter.com/_JohnHammond/status/1708910264261980634
- https://www.hexacorn.com/blog/2020/08/23/certutil-one-more-gui-lolbin
Author and attribution
- Author
- Nasreddine Bencherchali (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_certutil_download_direct_ip.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2