Skip to content
Threat Feed
medium advisory

Suspicious CertUtil Commands Used for Defense Evasion

Attackers abuse certutil.exe, a native Windows utility, to download/deobfuscate malware for command and control or data exfiltration, evading defenses.

CertUtil is a command-line utility included with Windows, designed for managing digital certificates and certificate services. Attackers frequently abuse it to “live off the land” by downloading malware, deobfuscating files, and establishing command and control channels within compromised environments. This activity leverages certutil.exe to perform actions typically associated with malicious payloads, blending in with legitimate system activity and evading traditional security measures. The tool’s capability to encode, decode, and retrieve files from URLs makes it a versatile asset for attackers aiming to maintain a low profile while executing malicious operations. This detection focuses on identifying specific command-line arguments indicative of this abuse, such as those used for encoding, decoding, and URL retrieval.

Attack Chain

  1. The attacker gains initial access through an undisclosed means (e.g., phishing, exploit).
  2. The attacker executes certutil.exe via cmd.exe or PowerShell.
  3. Certutil is used with the urlcache parameter to download a malicious payload from a remote server.
  4. Certutil uses the decode parameter to decode a base64-encoded payload, saving it to disk.
  5. The attacker uses certutil with encodehex to encode a binary into a hexadecimal representation to evade signature-based detection.
  6. The attacker then uses certutil with decodehex to decode the hexadecimal encoded data.
  7. The attacker executes the decoded payload, gaining further control of the system.
  8. The attacker establishes a command and control channel, using certutil to encode/decode communications.

Impact

Successful exploitation allows attackers to download and execute arbitrary code, bypass security measures, and maintain persistence within the compromised system. This can lead to data exfiltration, system compromise, and further propagation of the attack within the network. The lack of directly observed IOCs in the originating advisory limits quantification of victim count and impact scope, but the technique is widely applicable.

Recommendation

  • Deploy the Sigma rule “Suspicious CertUtil Usage for Encoding/Decoding” to detect abuse of encoding/decoding functions within certutil.exe, focusing on unusual file types or destinations.
  • Deploy the Sigma rule “Suspicious CertUtil URL Download” to identify certutil.exe being used to download files from URLs, and tune the rule based on known good software deployment practices.
  • Enable Sysmon process creation logging to ensure the rules above function correctly by capturing command-line arguments (as referenced in the logsource for each rule).
  • Review historical process execution logs for instances of certutil.exe using suspicious parameters like decode, encode, urlcache, verifyctl, encodehex, decodehex, or exportPFX to identify potentially compromised systems.

Detection coverage 2

Suspicious CertUtil Usage for Encoding/Decoding

high

Detects suspicious use of certutil.exe to encode or decode files, which is often used to obfuscate malicious payloads.

sigma tactics: defense_evasion techniques: T1140 sources: process_creation, windows

Suspicious CertUtil URL Download

medium

Detects certutil.exe being used to download files from URLs, which is often a sign of malicious activity.

sigma tactics: command_and_control techniques: T1105 sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →