Invalid Code Signature
Adversaries may attempt to mimic features of valid code signatures to increase the chance of deceiving a user, analyst, or tool. Code signing provides a level of authenticity on a binary from the developer and a guarantee that the binary has not been tampered with. Adversaries can copy the metadata and signature information from a signed program, then use it as a template for an unsigned program. Files with invalid code signatures will fail digital signature validation checks, but they may appear more legitimate to users and security tools may improperly handle these files. Unlike Code Signing (T1553.002), this activity will not result in a valid signature.
DeviceFileCertificateInfo
| where Timestamp > ago(24h)
| where IsRootSignerMicrosoft == false or SignatureState != "Valid"
| where isnotempty(Signer)
| join kind=inner (
DeviceProcessEvents
| where Timestamp > ago(24h)
| where isnotempty(SHA1)
) on $left.SHA1 == $right.SHA1
| where SignatureState in ("Invalid", "Untrusted", "Expired", "Revoked")
| project Timestamp, DeviceName, FileName, FolderPath, Signer, SignatureState, IsTrusted,
ProcessCommandLine, InitiatingProcessFileName, AccountName
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Expired certificates on legitimate but outdated software that has not been updated
- Self-signed certificates used by internal development or testing tools
- Legitimate software with misconfigured or incomplete signing (common in some open-source tools)
- Revoked certificates that were legitimately used before revocation and may still be in software repos
References (6)
- https://attack.mitre.org/techniques/T1036/001/
- https://threatexpress.com/blogs/2017/metatwin-borrowing-microsoft-metadata-and-digital-signatures-to-hide-binaries/
- https://github.com/secretsquirrel/SigThief
- https://learn.microsoft.com/en-us/sysinternals/downloads/sigcheck
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1036.001/T1036.001.md
- https://posts.specterops.io/code-signing-certificate-cloning-attacks-and-defenses-6f98657fc6ec
Unlock Pro Content
Get the full detection package for T1036.001 including response playbook, investigation guide, and atomic red team tests.