T1553.002

Code Signing

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.

Microsoft Sentinel / Defender
kusto
let SuspiciousSigntoolPatterns = dynamic([
  "/sign", "-sign",
  "/f ", "-f ",
  "/p ", "-p ",
  "/fd ", "-fd ",
  "/tr ", "-tr ",
  "sha256", "sha1"
]);
let CertToolPatterns = dynamic([
  "-addstore", "-addcert",
  "-importpfx", "-p12",
  "MY", "Root", "TrustedPublisher"
]);
// Detection 1: signtool.exe invocations from non-standard parent processes
let SigntoolDetection = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "signtool.exe"
| where ProcessCommandLine has_any (SuspiciousSigntoolPatterns)
| extend SuspiciousParent = InitiatingProcessFileName has_any (
    "cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", 
    "cscript.exe", "mshta.exe", "rundll32.exe", "explorer.exe"
  )
| extend SigningPFX = ProcessCommandLine has_any (".pfx", ".p12")
| extend TimestampServer = ProcessCommandLine has "/tr" or ProcessCommandLine has "-tr"
| extend SelfSigned = ProcessCommandLine !has "/tr" and ProcessCommandLine !has "-tr"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         SuspiciousParent, SigningPFX, TimestampServer, SelfSigned
| extend DetectionType = "SigntoolExecution";
// Detection 2: certutil importing certificates into trusted stores
let CertutilDetection = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "certutil.exe"
| where ProcessCommandLine has_any (CertToolPatterns)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| extend DetectionType = "CertutilCertImport"
| extend SuspiciousParent = InitiatingProcessFileName has_any (
    "cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe"
  )
| extend SigningPFX = ProcessCommandLine has_any (".pfx", ".p12")
| extend TimestampServer = false
| extend SelfSigned = false;
// Detection 3: pfx/p12 certificate files created in suspicious locations
let CertFileCreation = DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName endswith ".pfx" or FileName endswith ".p12" or FileName endswith ".cer" or FileName endswith ".crt"
| where FolderPath has_any ("Temp", "Downloads", "AppData\\Local", "AppData\\Roaming", "Users\\Public", "ProgramData")
| project Timestamp, DeviceName, InitiatingProcessAccountName, FileName, FolderPath,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| extend DetectionType = "SuspiciousCertFileCreation"
| extend SuspiciousParent = true
| extend SigningPFX = true
| extend TimestampServer = false
| extend SelfSigned = false
| project-rename AccountName = InitiatingProcessAccountName;
// Detection 4: Registry modifications to trusted publisher or root CA stores
let CertStoreModification = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType == "RegistryValueSet"
| where RegistryKey has_any (
    "ROOT\\Certificates",
    "TrustedPublisher\\Certificates",
    "AuthRoot\\Certificates",
    "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\ROOT",
    "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\TrustedPublisher"
  )
| project Timestamp, DeviceName, InitiatingProcessAccountName, RegistryKey, RegistryValueName,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| extend DetectionType = "CertStoreRegistryMod"
| extend SuspiciousParent = InitiatingProcessFileName !in~ ("certutil.exe", "mmc.exe", "wuauclt.exe", "TrustedInstaller.exe", "svchost.exe")
| extend SigningPFX = false
| extend TimestampServer = false
| extend SelfSigned = false
| project-rename AccountName = InitiatingProcessAccountName;
union isfuzzy=true SigntoolDetection, CertutilDetection, CertStoreModification
| sort by Timestamp desc
high severity medium confidence

Data Sources

Process: Process Creation File: File Creation Windows Registry: Windows Registry Key Modification Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceFileEvents DeviceRegistryEvents

False Positives

  • Legitimate software developers signing their builds using signtool.exe in CI/CD pipelines (Azure DevOps, Jenkins build agents) — parent processes may be cmd.exe or powershell.exe in these environments
  • Certificate authority and PKI administrators importing new root or intermediate CA certificates via certutil.exe or mmc.exe as part of enterprise PKI management
  • Software installers bundled with vendor-signed binaries that import product-specific root certificates during installation (e.g., corporate VPN clients, enterprise security products)
  • Automated patch management solutions (WSUS, SCCM) that update trusted root certificate stores as part of Windows Update processes
  • Security scanning tools that create temporary certificate files when testing SSL/TLS configurations

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