Execution · Windows · LOLBAS
certutil.exe
Certificate Services utility
Manages certificates, but it can also download files from a URL and encode or decode data. Those side features make it a common tool for pulling in and unpacking payloads.
Legitimate use
Admins use it to manage certificates, CAs and certificate stores.
Switches
Fetches a URL into the local cache. With -f it downloads a file to a chosen path.
HighAnother switch that can download a file from a URL.
HighOpens a URL retrieval dialog, and can fetch a URL.
MediumDecodes a Base64 file back to its raw bytes. Used to unpack a payload after transfer.
HighDecodes a hex-encoded file to raw bytes.
HighBase64-encodes a file, for example to move a binary as text.
MediumSplits an encoded file. Sometimes used to reassemble content.
LowForce: overwrite output and force the URL fetch. Routinely paired with -urlcache for downloads.
MediumPrints a file hash. Benign on its own.
InfoCommand lines to worry about
- High
File download with certutil
certutil -urlcache -f fetches a file from a URL to disk. A very common way to bring in a second stage. Check the URL and the saved path.
Detection regex
certutil(\.exe)?\s+.*-urlcache\b.*-f\b.*https?:\/\/|certutil(\.exe)?\s+.*-f\b.*-urlcache\b.*https?:\/\/ - High
Decode a staged file
certutil decodes an encoded file to its raw form, often right after a download, to unpack an executable or script.
Detection regex
certutil(\.exe)?\s+.*-(decode|decodehex)\b - High
Download through -verifyctl
An alternative certutil download that is less widely monitored. Treat like a -urlcache download.
Detection regex
certutil(\.exe)?\s+.*-verifyctl\b.*https?:\/\/
Where it is recorded
- Security4688Process creation with the full command line, when command-line auditing is enabled.
- Sysmon1Process creation with command line, hashes and parent process.
- Sysmon3Network connection to the download URL.
- Sysmon11File created when the download or decode writes to disk.
- %USERPROFILE%\AppData\LocalLow\Microsoft\CryptnetUrlCacheCryptnetUrlCache holds URLs and content fetched by certutil, which links a download to a host and time.
- Prefetch CERTUTIL.EXE-*.pfPrefetch confirms certutil ran and when, even if the command line was not captured.
Community detections
28 SigmaHQ rules for certutil.exe. The explainer checks every pasted command line against all of them.
- HighFile Decoded From Base64/Hex Via Certutil.EXE
Detects the execution of certutil with either the "decode" or "decodehex" flags to decode base64 or hex encoded files. This can be abused by attackers to decode an encoded payload before execution
T1027by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community
- HighFile In Suspicious Location Encoded To Base64 Via Certutil.EXE
Detects the execution of certutil with the "encode" flag to encode a file to base64 where the files are located in potentially suspicious locations
T1027by Nasreddine Bencherchali (Nextron Systems)
- HighHTML Help HH.EXE Suspicious Child Process
Detects a suspicious child process of a Microsoft HTML Help (HH.exe)
T1047T1059.001T1059.003T1059.005by Maxim Pavlunin, Nasreddine Bencherchali (Nextron Systems)
- HighPotential Defense Evasion Via Rename Of Highly Relevant Binaries
Detects the execution of a renamed binary often used by attackers or malware leveraging new Sysmon OriginalFileName datapoint.
T1036.003by Matthew Green - @mgreen27, Florian Roth (Nextron Systems), frack113
- HighPotential NTLM Coercion Via Certutil.EXE
Detects possible NTLM coercion via certutil using the 'syncwithWU' flag
T1218by Nasreddine Bencherchali (Nextron Systems)
- HighPotentially Suspicious Execution From Parent Process In Public Folder
Detects a potentially suspicious execution of a parent process located in the "\Users\Public" folder executing a child process containing references to shell or scripting binaries and commandlines.
T1564T1059by Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious Child Process Of Manage Engine ServiceDesk
Detects suspicious child processes of the "Manage Engine ServiceDesk Plus" Java web service
T1102by Florian Roth (Nextron Systems)
- HighSuspicious File Downloaded From Direct IP Via Certutil.EXE
Detects the execution of certutil with certain flags that allow the utility to download files from direct IPs.
T1027T1105by Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious File Downloaded From File-Sharing Website Via Certutil.EXE
Detects the execution of certutil with certain flags that allow the utility to download files from file-sharing websites.
T1027T1105by Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious File Encoded To Base64 Via Certutil.EXE
Detects the execution of certutil with the "encode" flag to encode a file to base64 where the extensions of the file is suspicious
T1027by Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious Microsoft Office Child Process
Detects a suspicious process spawning from one of the Microsoft Office suite products (Word, Excel, PowerPoint, Publisher, Visio, etc.)
T1047T1204.002T1218.010by Florian Roth (Nextron Systems), Markus Neis, FPT.EagleEye Team, Vadim Khrykov, Cyb3rEng, Michael Haag, Christopher Peacock @securepeacock, @scythe_io
- HighSuspicious Microsoft OneNote Child Process
Detects suspicious child processes of the Microsoft OneNote application. This may indicate an attempt to execute malicious embedded objects from a .one file.
T1566T1566.001by Tim Rauch (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), Elastic (idea)
- HighSuspicious Process By Web Server Process
Detects potentially suspicious processes being spawned by a web server process which could be the result of a successfully placed web shell or exploitation
T1505.003T1190by Thomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious Processes Spawned by Java.EXE
Detects suspicious processes spawned from a Java host process which could indicate a sign of exploitation (e.g. log4j)
by Andreas Hunkeler (@Karneades), Florian Roth
- HighSuspicious Processes Spawned by WinRM
Detects suspicious processes including shells spawnd from WinRM host process
T1190by Andreas Hunkeler (@Karneades), Markus Neis
- HighSuspicious Shells Spawn by Java Utility Keytool
Detects suspicious shell spawn from Java utility keytool process (e.g. adselfservice plus exploitation)
by Andreas Hunkeler (@Karneades)
- HighSuspicious Spool Service Child Process
Detects suspicious print spool service (spoolsv.exe) child processes.
T1203T1068by Justin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)
- HighSuspicious WmiPrvSE Child Process
Detects suspicious and uncommon child processes of WmiPrvSE
T1047T1204.002T1218.010by Vadim Khrykov (ThreatIntel), Cyb3rEng, Florian Roth (Nextron Systems)
- HighSystem File Execution Location Anomaly
Detects the execution of a Windows system binary that is usually located in the system folder from an uncommon location.
T1036by Florian Roth (Nextron Systems), Patrick Bareiss, Anton Kutepov, oscd.community, Nasreddine Bencherchali (Nextron Systems)
- HighWindows Shell/Scripting Processes Spawning Suspicious Programs
Detects suspicious child processes of a Windows shell and scripting processes such as wscript, rundll32, powershell, mshta...etc.
T1059.005T1059.001T1218by Florian Roth (Nextron Systems), Tim Shelton
- MediumCertificate Exported Via Certutil.EXE
Detects the execution of the certutil with the "exportPFX" flag which allows the utility to export certificates.
T1027by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community, Nasreddine Bencherchali (Nextron Systems)
- MediumFile Encoded To Base64 Via Certutil.EXE
Detects the execution of certutil with the "encode" flag to encode a file to base64. This can be abused by threat actors and attackers for data exfiltration
T1027by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community, Nasreddine Bencherchali (Nextron Systems)
- MediumLOLBIN Execution From Abnormal Drive
Detects LOLBINs executing from an abnormal or uncommon drive such as a mounted ISO.
by Christopher Peacock '@securepeacock', SCYTHE '@scythe_io', Angelo Violetti - SEC Consult '@angelo_violetti', Aaron Herman
- MediumNew Root Certificate Installed Via Certutil.EXE
Detects execution of "certutil" with the "addstore" flag in order to install a new certificate on the system. Adversaries may install a root certificate on a compromised system to avoid warnings when connecting to adversary controlled web servers.
T1553.004by oscd.community, @redcanary, Zach Stanford @svch0st
- MediumPotentially Suspicious Child Process Of DiskShadow.EXE
Detects potentially suspicious child processes of "Diskshadow.exe". This could be an attempt to bypass parent/child relationship detection or application whitelisting rules.
T1218by Nasreddine Bencherchali (Nextron Systems)
- MediumPotentially Suspicious Execution Of PDQDeployRunner
Detects suspicious execution of "PDQDeployRunner" which is part of the PDQDeploy service stack that is responsible for executing commands and packages on a remote machines
by Nasreddine Bencherchali (Nextron Systems)
- MediumSuspicious Download Via Certutil.EXE
Detects the execution of certutil with certain flags that allow the utility to download files.
T1027T1105by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community, Nasreddine Bencherchali (Nextron Systems)
- MediumSuspicious WindowsTerminal Child Processes
Detects suspicious children spawned via the Windows Terminal application which could be a sign of persistence via WindowsTerminal (see references section)
by Nasreddine Bencherchali (Nextron Systems)
Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.