T1553

Subvert Trust Controls

Defense Evasion Last updated:

Adversaries may undermine security controls that warn users of untrusted activity or prevent execution of untrusted programs. Operating systems and security products contain mechanisms to identify programs or websites as possessing some level of trust, such as code signing certificates, Mark-of-the-Web (MOTW) attributes, Gatekeeper on macOS, or SIP and Trust Provider validation on Windows. Adversaries attempt to subvert these trust mechanisms through techniques including code signing certificate theft or forgery, MOTW removal, root certificate installation, SIP/Trust Provider hijacking, and Gatekeeper bypass. The method used depends on the specific mechanism being subverted.

What is T1553 Subvert Trust Controls?

Subvert Trust Controls (T1553) maps to the Defense Evasion tactic — the adversary is trying to avoid being detected in MITRE ATT&CK.

This page provides production-ready detection logic for Subvert Trust Controls, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Windows Registry: Registry Key Modification, Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1553 Subvert Trust Controls
Canonical reference
https://attack.mitre.org/techniques/T1553/
Microsoft Sentinel / Defender
kusto
let SuspiciousCertOps = dynamic(["certutil", "certmgr", "certreq", "makecert", "pvk2pfx", "signtool"]);
let RootCertPaths = dynamic(["ROOT", "TRUSTEDPUBLISHER", "TRUSTEDPEOPLE", "AUTHROOT"]);
let MotwRemovalPatterns = dynamic(["Zone.Identifier", ":Zone.Identifier", "Unblock-File", "ZoneId"]);
// Branch 1: Certificate store manipulation via certutil
let CertutilOps = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "certutil.exe"
| where ProcessCommandLine has_any ("-addstore", "-delstore", "-importpfx", "-user -addstore", "-enterprise", "-f -addstore")
| extend DetectionBranch = "CertStore_Manipulation"
| extend SuspicionScore = case(
    ProcessCommandLine has "-addstore" and ProcessCommandLine has_any ("ROOT", "AUTHROOT", "TRUSTEDPUBLISHER"), 3,
    ProcessCommandLine has "-importpfx", 2,
    ProcessCommandLine has "-addstore", 1,
    1);
// Branch 2: MOTW removal or ADS deletion
let MotwRemoval = DeviceProcessEvents
| where Timestamp > ago(24h)
| where (FileName =~ "powershell.exe" or FileName =~ "pwsh.exe" or FileName =~ "cmd.exe")
| where ProcessCommandLine has_any (MotwRemovalPatterns)
| extend DetectionBranch = "MOTW_Removal"
| extend SuspicionScore = case(
    ProcessCommandLine has "Unblock-File", 2,
    ProcessCommandLine has "Zone.Identifier" and ProcessCommandLine has_any ("del", "remove", "erase", "Set-Content"), 3,
    1);
// Branch 3: Registry modifications to trust providers or authenticode
let TrustRegistryMod = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has_any (
    "SOFTWARE\\Microsoft\\Cryptography\\OID",
    "SOFTWARE\\Microsoft\\Cryptography\\Providers",
    "SOFTWARE\\Policies\\Microsoft\\SystemCertificates",
    "SOFTWARE\\Microsoft\\EnterpriseCertificates",
    "SYSTEM\\CurrentControlSet\\Control\\SecurityProviders"
  )
| where ActionType in~ ("RegistryValueSet", "RegistryKeyCreated")
| extend DetectionBranch = "Trust_Registry_Modification"
| extend SuspicionScore = 2
| project Timestamp, DeviceName, AccountName,
    FileName = InitiatingProcessFileName,
    ProcessCommandLine = InitiatingProcessCommandLine,
    InitiatingProcessFileName, InitiatingProcessCommandLine,
    DetectionBranch, SuspicionScore;
// Branch 4: Signed binary proxy / catalog hijacking
let SigToolUsage = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "signtool.exe"
| extend DetectionBranch = "Signtool_Usage"
| extend SuspicionScore = case(
    ProcessCommandLine has "sign" and ProcessCommandLine has "/fd", 2,
    1);
// Union all branches
let ProcessAlerts = union CertutilOps, MotwRemoval, SigToolUsage
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         DetectionBranch, SuspicionScore;
union ProcessAlerts, TrustRegistryMod
| where SuspicionScore >= 1
| sort by SuspicionScore desc, Timestamp desc

Detects attempts to subvert Windows trust controls across four detection branches: (1) certutil manipulating certificate stores including root/trusted publisher stores, (2) Mark-of-the-Web removal via PowerShell Unblock-File or direct ADS deletion, (3) registry modifications to cryptographic trust providers and certificate policy keys, (4) signtool.exe usage for signing operations. Each branch assigns a suspicion score; scores of 3 indicate high-confidence malicious activity such as adding certificates to the ROOT store.

high severity medium confidence

Data Sources

Process: Process Creation Command: Command Execution Windows Registry: Registry Key Modification Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceRegistryEvents

False Positives

  • Enterprise PKI administrators legitimately adding internal CA certificates to ROOT or TRUSTEDPUBLISHER stores via certutil
  • Software developers using signtool.exe to sign their own applications during build processes
  • IT administrators using Unblock-File or removing Zone.Identifier from files downloaded from trusted internal shares
  • Group Policy or MDM (Intune) operations that deploy enterprise certificates to certificate stores
  • Security tools like antivirus or EDR solutions that modify trust provider registry keys during installation or updates

Sigma rule & cross-platform mapping

The detection logic for Subvert Trust Controls (T1553) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


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 1Add Self-Signed Root Certificate to Windows ROOT Store

    Expected signal: Sysmon Event ID 1: Process Create with Image=certutil.exe, CommandLine containing '-addstore ROOT'. Security Event ID 4688 (if command line auditing enabled). Windows CertificateServicesClient-Lifecycle-System/Operational Event ID 1001 (certificate installed). CAPI2 Operational log entries for certificate store modification.

  2. Test 2Remove Mark-of-the-Web via PowerShell Unblock-File

    Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing 'Unblock-File' and the target file path. Sysmon Event ID 23 or 26 (File Delete) for the Zone.Identifier ADS removal. PowerShell ScriptBlock Log Event ID 4104 showing the Unblock-File command. Security Event ID 4663 (object access) if file system auditing is enabled for the temp directory.

  3. Test 3Remove Zone.Identifier ADS via cmd.exe del command

    Expected signal: Sysmon Event ID 1: cmd.exe with CommandLine containing 'Zone.Identifier' and 'del'. Sysmon Event ID 23 (File Delete) for the ADS. Security Event ID 4688 if command line auditing is enabled. Note: some EDR solutions specifically monitor for ADS deletion on .exe files.

  4. Test 4Inspect and Enumerate SIP Trust Provider Registry Keys

    Expected signal: Sysmon Event ID 1: reg.exe with CommandLine querying Cryptography\OID paths. Security Event ID 4663 (registry object access) if registry auditing is enabled. No modifications occur — this tests detection of enumeration prior to hijacking.


Response Playbook

Triage

  1. Identify which trust subversion branch triggered: certificate store manipulation, MOTW removal, registry trust provider modification, or code signing tool abuse — each has distinct follow-up steps
  2. For certutil -addstore ROOT alerts: immediately inspect the certificate being added — extract it with: certutil -dump <cert_file> — check Issuer, Subject, Thumbprint, and ValidFrom/To fields. Is this an internal CA cert or an unknown/self-signed certificate?
  3. For MOTW removal alerts: identify the specific file that had Zone.Identifier removed. Check when the file arrived, from what URL (preserved in Zone.Identifier before deletion), and whether it was subsequently executed. Use: Get-Item <file> -Stream * to check remaining ADS
  4. For registry modification alerts: examine the specific key modified under HKLM\SOFTWARE\Microsoft\Cryptography\OID or trust provider paths. Compare against known-good baseline — unexpected DLL references in trust provider keys indicate SIP/Trust Provider hijacking
  5. Check the parent process of the suspicious activity — certutil spawned by mshta.exe, wscript.exe, or Office applications is high-priority. Certutil spawned by SCCM (ccmexec.exe) is likely legitimate
  6. Verify the user context: PKI admin service account modifying ROOT store is expected; standard user account or suspicious service account performing the same action is not
  7. Check for preceding file download events in DeviceFileEvents or network connections that preceded the trust subversion — this may indicate a multi-stage attack sequence

Containment

  1. If unknown root certificate installed: immediately remove it with certutil -delstore ROOT <thumbprint> and document the thumbprint for IOC sharing
  2. If MOTW was removed from a malicious file that was subsequently executed: isolate the endpoint immediately via EDR network isolation or VLAN quarantine
  3. If Trust Provider or SIP registry keys were modified: revert the registry changes to restore legitimate DLL references, then scan the replacement DLL for malicious code
  4. Block the certificate thumbprint/serial number at the enterprise CA and in any PKI infrastructure (OCSP/CRL) if stolen or forged certificates are identified
  5. If code signing certificate compromise is confirmed: revoke the certificate at the CA, notify the certificate authority for public certificates, and alert all downstream consumers of software signed with the compromised cert
  6. Disable or quarantine the user account associated with unauthorized certificate store modifications and revoke all active authentication tokens

Evidence Collection

  1. Certificate Store Inventory: certutil -store ROOT and certutil -store TRUSTEDPUBLISHER — export full list before and after incident for comparison
  2. Installed certificate details: certutil -store -enterprise ROOT and certutil -user -store ROOT for both machine and user certificate stores
  3. Registry export of trust provider keys: reg export HKLM\SOFTWARE\Microsoft\Cryptography\OID\EncodingType\ <output.reg> and reg export HKLM\SOFTWARE\Microsoft\Cryptography\Providers\ <output.reg>
  4. Sysmon Event ID 1 (Process Create) and 12/13/14 (Registry Create/Set/Delete) from the timeframe of the incident
  5. Security Event ID 4657 (Registry Value Modified) if object access auditing is enabled for registry keys
  6. File system: collect the original certificate file (.cer, .crt, .pfx) if still present — preserve with timestamps using robocopy /COPYALL
  7. PowerShell ScriptBlock Logging (Event ID 4104) for any PowerShell involved in MOTW removal or certificate operations
  8. Prefetch: C:\Windows\Prefetch\CERTUTIL.EXE-*.pf for execution history and loaded modules
  9. Windows Event Log: Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational for certificate lifecycle events (Event IDs 1001-1003)

Escalation Criteria

  • ! Unknown or self-signed certificate added to ROOT or TRUSTEDPUBLISHER certificate store — this enables trust of any malware signed with that certificate
  • ! Trust Provider or SIP DLL replaced with a non-Microsoft, non-vendor-signed binary — direct indicator of SIP/Trust Provider hijacking for code signing bypass
  • ! MOTW removed from a file that was subsequently executed and made network connections — indicates weaponized file that bypassed initial execution guardrails
  • ! Certificate operations performed by non-PKI-admin accounts, especially on servers or domain controllers
  • ! Multiple endpoints showing identical certificate installations within a short time window — indicates automated deployment of malicious root certificate across the environment
  • ! Certutil spawned by browser, Office application, or script interpreter (wscript.exe, mshta.exe, cscript.exe) — indicates drive-by or phishing-delivered certificate installation

Investigation Guide

Forensic Artifacts

  • > Registry: HKLM\SOFTWARE\Microsoft\SystemCertificates\ROOT\Certificates — machine-level root certificates (each subkey is a thumbprint)
  • > Registry: HKCU\SOFTWARE\Microsoft\SystemCertificates\ROOT\Certificates — user-level root certificates
  • > Registry: HKLM\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptSIPDllVerifyIndirectData — SIP verification DLL references (hijacking target)
  • > Registry: HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\FinalPolicy — Trust Provider final policy DLL references
  • > File System: C:\Windows\System32\catroot\ — Windows catalog files for signed drivers and system files
  • > File System: C:\Windows\System32\catroot2\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\catdb — catalog database
  • > Event Log: Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational — certificate lifecycle (install/remove/renewal)
  • > Event Log: Microsoft-Windows-CAPI2/Operational — detailed certificate chain validation failures and successes
  • > Event Log: Security Event ID 4986/4987/4988 — IPsec certificate related events (if applicable)
  • > WMI: SELECT * FROM Win32_Certificate — installed certificates via WMI query
  • > File System: %APPDATA%\Microsoft\SystemCertificates\My — user personal certificate store
  • > File System: C:\Windows\Prefetch\CERTUTIL.EXE-*.pf — certutil execution history

Tuning Guidance

The highest-fidelity signal is certutil -addstore ROOT or -addstore TRUSTEDPUBLISHER — legitimate PKI admin operations exist but are rare and should occur from known admin workstations with change ticket correlation. Build an allowlist of: (1) known PKI admin hostnames and service account names, (2) known enterprise CA certificate thumbprints deployed via Group Policy, (3) approved build server hostnames for signtool.exe usage. For MOTW removal, the most important context is what file had MOTW removed and whether it was subsequently executed — correlate DeviceFileEvents and DeviceProcessEvents within a 5-minute window. For registry trust provider modifications, baseline the expected DLL set for your environment (virtually always the same Microsoft system DLLs) and alert on ANY deviation — this is a very low-noise, high-fidelity signal. Enable Windows CAPI2 operational logging for detailed certificate validation telemetry: Event Viewer > Applications and Services Logs > Microsoft > Windows > CAPI2 > Operational.


Hunting Queries

Hunt for certutil operations adding certificates to high-trust stores (ROOT, TRUSTEDPUBLISHER, AUTHROOT). Any ROOT store addition by a non-PKI process parent is suspicious. High device count or multiple users performing the same operation may indicate automated deployment of a malicious root CA.

Hunting — KQL
kql
// Hunt for certutil adding to high-trust certificate stores
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "certutil.exe"
| where ProcessCommandLine has "-addstore"
| extend TargetStore = extract("-addstore\\s+(\\S+)", 1, ProcessCommandLine)
| extend IsHighRisk = TargetStore in~ ("ROOT", "AUTHROOT", "TRUSTEDPUBLISHER", "TRUSTEDPEOPLE")
| summarize Count=count(), Devices=dcount(DeviceName), UniqueUsers=dcount(AccountName),
           Commands=make_set(ProcessCommandLine), Earliest=min(Timestamp), Latest=max(Timestamp)
           by TargetStore, InitiatingProcessFileName, IsHighRisk
| where IsHighRisk == true or Count > 3
| sort by IsHighRisk desc, Count desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  Image="*\\certutil.exe" CommandLine="*-addstore*"
| rex field=CommandLine "-addstore\s+(?<TargetStore>\S+)"
| eval IsHighRisk=if(match(lower(TargetStore), "(root|authroot|trustedpublisher|trustedpeople)"), "YES", "NO")
| stats count as Count, dc(host) as Devices, dc(User) as UniqueUsers,
        values(CommandLine) as Commands, earliest(_time) as Earliest, latest(_time) as Latest
        by TargetStore, ParentImage, IsHighRisk
| where IsHighRisk="YES" OR Count > 3
| sort - IsHighRisk, - Count

Hunt for Mark-of-the-Web removal using multiple methods: PowerShell Unblock-File cmdlet, direct Zone.Identifier ADS deletion via cmd del, Set-Content to overwrite the ADS, and Sysinternals streams.exe with -d flag. MOTW removal is frequently performed immediately before executing a downloaded payload to bypass SmartScreen.

Hunting — KQL
kql
// Hunt for MOTW removal patterns — Zone.Identifier ADS manipulation
DeviceProcessEvents
| where Timestamp > ago(7d)
| where (FileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe")
         and ProcessCommandLine has_any ("Zone.Identifier", "Unblock-File"))
    or (FileName =~ "streams.exe")  // Sysinternals streams tool used to delete ADS
| extend MotwMethod = case(
    ProcessCommandLine has "Unblock-File", "Unblock-File cmdlet",
    ProcessCommandLine has "Zone.Identifier" and ProcessCommandLine has_any ("del", "erase", "rm", "remove"), "Direct ADS deletion",
    ProcessCommandLine has "Zone.Identifier" and ProcessCommandLine has "Set-Content", "ADS content modification",
    FileName =~ "streams.exe" and ProcessCommandLine has "-d", "Streams.exe delete",
    "Unknown MOTW method")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, MotwMethod
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  ((Image="*\\powershell.exe" OR Image="*\\pwsh.exe" OR Image="*\\cmd.exe")
    (CommandLine="*Zone.Identifier*" OR CommandLine="*Unblock-File*"))
  OR (Image="*\\streams.exe" CommandLine="*-d*")
| eval MotwMethod=case(
    match(CommandLine, "Unblock-File"), "Unblock-File cmdlet",
    match(CommandLine, "Zone\.Identifier") AND match(CommandLine, "(del |erase|rm )"), "Direct ADS deletion",
    match(CommandLine, "Zone\.Identifier") AND match(CommandLine, "Set-Content"), "ADS modification",
    match(Image, "streams\.exe") AND match(CommandLine, "-d"), "Streams.exe delete",
    true(), "MOTW manipulation")
| table _time, host, User, Image, CommandLine, ParentImage, MotwMethod
| sort - _time

Hunt for SIP (Subject Interface Package) and Trust Provider DLL hijacking by monitoring registry modifications to CryptSIPDll entries and Trust Provider FinalPolicy/InitProvider keys. Filters out known-legitimate Microsoft DLLs (wintrust.dll, softpub.dll) to surface non-standard DLL registrations that may indicate hijacking. This is the key detection for T1553.003.

Hunting — KQL
kql
// Hunt for suspicious trust provider / SIP registry modifications
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where RegistryKey has_any (
    "CryptSIPDll",
    "Trust\\FinalPolicy",
    "Trust\\InitProvider",
    "Trust\\TestCert",
    "SOFTWARE\\Microsoft\\Cryptography\\OID"
  )
| where ActionType in~ ("RegistryValueSet", "RegistryKeyCreated")
| extend IsDllRef = RegistryValueData has_any (".dll", "DLL")
| extend IsNonSystem = not(RegistryValueData has_any ("wintrust.dll", "cryptui.dll", "mssign32.dll", "softpub.dll"))
| where IsDllRef and IsNonSystem
| project Timestamp, DeviceName, AccountName, RegistryKey, RegistryValueName,
         RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" (EventCode=12 OR EventCode=13 OR EventCode=14)
  (TargetObject="*CryptSIPDll*" OR TargetObject="*Trust\\FinalPolicy*" OR TargetObject="*Trust\\InitProvider*"
   OR TargetObject="*CryptSIPDllVerifyIndirectData*" OR TargetObject="*Cryptography\\OID*")
| eval IsDllRef=if(match(Details, "\.dll"), 1, 0)
| eval IsNonSystem=if(match(lower(Details), "(wintrust|cryptui|mssign32|softpub)"), 0, 1)
| where IsDllRef=1 AND IsNonSystem=1
| table _time, host, User, EventCode, TargetObject, Details, Image, CommandLine
| sort - _time

Atomic Red Team Tests

Test 1 Add Self-Signed Root Certificate to Windows ROOT Store
windows

Creates a self-signed certificate and installs it into the machine's ROOT (Trusted Root Certification Authorities) certificate store using certutil. This simulates the T1553.004 sub-technique where adversaries install malicious root CAs to enable man-in-the-middle attacks or trust malicious signed payloads. Run cleanup immediately after testing.

Command

powershell
$cert = New-SelfSignedCertificate -DnsName 'malicious-ca.test' -CertStoreLocation 'Cert:\LocalMachine\My' -KeyUsage CertSign -Type Custom -Subject 'CN=MaliciousTestCA'
$thumbprint = $cert.Thumbprint
certutil -addstore ROOT Cert:\LocalMachine\My\$thumbprint
Write-Output "Installed test root cert: $thumbprint"

Cleanup

powershell
$thumbprint = (Get-ChildItem Cert:\LocalMachine\ROOT | Where-Object {$_.Subject -like '*MaliciousTestCA*'}).Thumbprint
if ($thumbprint) { certutil -delstore ROOT $thumbprint; Write-Output "Removed cert: $thumbprint" }
Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Subject -like '*MaliciousTestCA*'} | Remove-Item

Expected Telemetry

Sysmon Event ID 1: Process Create with Image=certutil.exe, CommandLine containing '-addstore ROOT'. Security Event ID 4688 (if command line auditing enabled). Windows CertificateServicesClient-Lifecycle-System/Operational Event ID 1001 (certificate installed). CAPI2 Operational log entries for certificate store modification.

Expected Detection

KQL Branch 1 fires: CertStore_Manipulation with RootStoreAdd=true, SuspicionScore=3. SPL: RootStoreAdd=1, SuspicionScore >= 2. HIGH severity alert.

Test 2 Remove Mark-of-the-Web via PowerShell Unblock-File
windows

Downloads a test file to simulate an internet-sourced file with Zone.Identifier ADS (MOTW), then removes the MOTW using PowerShell's Unblock-File cmdlet. This simulates T1553.005 where adversaries remove MOTW to bypass SmartScreen and other warnings before executing a downloaded payload.

Command

powershell
$testFile = "$env:TEMP\df00tech-motw-test.txt"
Set-Content -Path $testFile -Value 'test payload content'
# Simulate MOTW by adding Zone.Identifier ADS (ZoneId 3 = Internet zone)
Set-Content -Path "${testFile}:Zone.Identifier" -Value "[ZoneTransfer]`nZoneId=3`nReferrerUrl=https://malicious.example.com"
Write-Output "Zone.Identifier set: $(Get-Content ${testFile}:Zone.Identifier)"
# Now remove MOTW as an adversary would
Unblock-File -Path $testFile
Write-Output "MOTW removed via Unblock-File"

Cleanup

powershell
Remove-Item "$env:TEMP\df00tech-motw-test.txt" -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 1: powershell.exe with CommandLine containing 'Unblock-File' and the target file path. Sysmon Event ID 23 or 26 (File Delete) for the Zone.Identifier ADS removal. PowerShell ScriptBlock Log Event ID 4104 showing the Unblock-File command. Security Event ID 4663 (object access) if file system auditing is enabled for the temp directory.

Expected Detection

KQL Branch 2 fires: MOTW_Removal, UnblockFile=true, SuspicionScore=2. SPL: UnblockFile=1, MotwRemoval=1, SuspicionScore >= 2. Medium-High severity alert.

Test 3 Remove Zone.Identifier ADS via cmd.exe del command
windows

Directly deletes the Zone.Identifier alternate data stream from a file using the Windows command line. This is an alternative MOTW removal method that bypasses Unblock-File and is commonly used in batch scripts and malware droppers to remove trust warnings before executing downloaded payloads.

Command

powershell
set TESTFILE=%TEMP%\df00tech-ads-test.exe
echo MZ > %TESTFILE%
echo [ZoneTransfer] > "%TESTFILE%:Zone.Identifier"
echo ZoneId=3 >> "%TESTFILE%:Zone.Identifier"
type "%TESTFILE%:Zone.Identifier"
rem Now delete the MOTW ADS
cmd.exe /c "del /f "%TESTFILE%:Zone.Identifier""
echo MOTW removed via del command

Cleanup

powershell
del /f "%TEMP%\df00tech-ads-test.exe" 2>nul

Expected Telemetry

Sysmon Event ID 1: cmd.exe with CommandLine containing 'Zone.Identifier' and 'del'. Sysmon Event ID 23 (File Delete) for the ADS. Security Event ID 4688 if command line auditing is enabled. Note: some EDR solutions specifically monitor for ADS deletion on .exe files.

Expected Detection

KQL Branch 2 fires: MOTW_Removal via Zone.Identifier + del pattern, SuspicionScore=3. SPL: MotwRemoval=1, SuspicionScore >= 1.

Test 4 Inspect and Enumerate SIP Trust Provider Registry Keys
windows

Enumerates the SIP (Subject Interface Package) and Trust Provider DLL registry keys that adversaries target for T1553.003 hijacking. This read-only atomic test does not modify the registry but generates telemetry that validates hunting query coverage. In a real attack, an adversary would replace the DLL value with a malicious path.

Command

powershell
reg query "HKLM\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptSIPDllVerifyIndirectData" /s
reg query "HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\FinalPolicy" /s
reg query "HKLM\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptSIPDllGetSignedDataMsg" /s
Write-Output "SIP registry enumeration complete — in a real attack these DLL values would be replaced"

Expected Telemetry

Sysmon Event ID 1: reg.exe with CommandLine querying Cryptography\OID paths. Security Event ID 4663 (registry object access) if registry auditing is enabled. No modifications occur — this tests detection of enumeration prior to hijacking.

Expected Detection

Hunting queries detect the registry access pattern. Main detection query may not fire (read-only operation), but threat hunt query 3 (SIP registry modification hunt) validates coverage of the key paths. Analysts should alert on any subsequent write operations to these keys.

Related Detections