T1553.002 Elastic Security · Elastic

Detect Code Signing in Elastic Security

Adversaries may create, acquire, or steal code signing materials to sign their malware or tools. Code signing provides a level of authenticity on a binary from the developer and a guarantee that the binary has not been tampered with. Valid signatures can bypass security policies requiring signed code to execute, making this technique effective for defense evasion. Threat actors including FIN7, Scattered Spider, Kimsuky, and Patchwork have all leveraged purchased, stolen, or self-signed certificates to make malicious binaries appear legitimate.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1553 Subvert Trust Controls
Sub-technique
T1553.002 Code Signing
Canonical reference
https://attack.mitre.org/techniques/T1553/002/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.name with maxspan=5m
  [process where event.type == "start" and
   (process.name : "signtool.exe" or process.name : "certutil.exe") and
   (
     (process.name : "signtool.exe" and process.args : ("/sign", "-sign", "/f", "-f", "/p", "-p", "/fd", "-fd", "/tr", "-tr", "sha256", "sha1")) or
     (process.name : "certutil.exe" and process.args : ("-addstore", "-addcert", "-importpfx", "-p12", "MY", "Root", "TrustedPublisher"))
   )
  ] by process.pid
| where process.parent.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "explorer.exe")

any where event.category == "file" and
  file.extension : ("pfx", "p12", "cer", "crt") and
  file.path : ("*\\Temp\\*", "*\\Downloads\\*", "*\\AppData\\Local\\*", "*\\AppData\\Roaming\\*", "*\\Users\\Public\\*", "*\\ProgramData\\*")

any where event.category == "registry" and
  event.type == "change" and
  registry.path : (
    "*\\ROOT\\Certificates\\*",
    "*\\TrustedPublisher\\Certificates\\*",
    "*\\AuthRoot\\Certificates\\*",
    "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\ROOT\\*",
    "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\TrustedPublisher\\*"
  ) and
  not process.name : ("certutil.exe", "mmc.exe", "wuauclt.exe", "TrustedInstaller.exe", "svchost.exe")
high severity high confidence

Detects T1553.002 Code Signing abuse via signtool.exe or certutil.exe invocations from suspicious parent processes, certificate file creation in temp/user-writable paths, and unauthorized modifications to trusted certificate stores. Covers all four detection pillars: process execution, cert file drops, and registry-based cert store tampering.

Data Sources

Elastic Endpoint SecurityWinlogbeat with SysmonElastic Agent

Required Tables

logs-endpoint.events.process-*logs-endpoint.events.file-*logs-endpoint.events.registry-*winlogbeat-*

False Positives & Tuning

  • Legitimate software developers using signtool.exe to sign internal binaries during build pipelines — especially if the parent process is a CI/CD agent like jenkins.exe or msbuild.exe
  • IT administrators importing enterprise CA certificates into trusted stores using certutil.exe as part of MDM or Group Policy certificate deployment
  • Antivirus or endpoint security tools that create .pfx or .cer files during certificate pinning or local proxy inspection setup
Download portable Sigma rule (.yml)

Other platforms for T1553.002


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Create and Use a Self-Signed Code Signing Certificate

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with New-SelfSignedCertificate in command line. Sysmon Event ID 1: Process Create for signtool.exe with command line containing '/sign', '/f', '.pfx', '/fd sha256', and the target binary path. Sysmon Event ID 11: File creation events for df00tech-codesign.pfx and df00tech-test.exe in %TEMP%. PowerShell ScriptBlock Log Event ID 4104 with the New-SelfSignedCertificate and Export-PfxCertificate commands.

  2. Test 2Import Self-Signed Certificate into Trusted Publishers Store

    Expected signal: Sysmon Event ID 1: Process Create for certutil.exe with CommandLine containing '-addstore TrustedPublisher'. Sysmon Event ID 11: File creation for df00tech-publisher.cer in %TEMP%. Sysmon Event ID 13 (Registry Value Set): new value under HKLM\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates\ keyed by the certificate thumbprint. PowerShell ScriptBlock Log Event ID 4104 for the New-SelfSignedCertificate commands.

  3. Test 3Verify Signed Binary Execution Trust (Authenticode Check Bypass Simulation)

    Expected signal: Sysmon Event ID 1: Process Create for certutil.exe with '-addstore -user TrustedPublisher'. Sysmon Event ID 11: File creation events for df00tech-sign-test.cer and df00tech-payload.ps1 in %TEMP%. Sysmon Event ID 13: Registry modification under HKCU\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates (user-store variant). PowerShell ScriptBlock Log Event ID 4104 for Set-AuthenticodeSignature cmdlet execution.

  4. Test 4macOS Ad-Hoc Code Signing

    Expected signal: macOS Unified Log: codesign process execution with '--sign -' arguments visible in process audit logs. Endpoint Security Framework events for ES_EVENT_TYPE_NOTIFY_EXEC when codesign runs. Security.framework log entries in /var/log/system.log for code signing operations. If EDR is present (CrowdStrike, SentinelOne): process creation event for codesign with suspicious ad-hoc signing arguments. spctl execution generates Gatekeeper assessment log entries in /var/log/system.log.

Unlock Pro Content

Get the full detection package for T1553.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections