Microsoft Windows Defender Tampering

Identifies when one or more features on Microsoft Defender are disabled. Adversaries may disable or tamper with Microsoft Defender features to evade detection and conceal malicious behavior.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/10/18"
  3integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
  4maturity = "production"
  5updated_date = "2025/03/27"
  6
  7[rule]
  8author = ["Austin Songer"]
  9description = """
 10Identifies when one or more features on Microsoft Defender are disabled. Adversaries may disable or tamper with
 11Microsoft Defender features to evade detection and conceal malicious behavior.
 12"""
 13false_positives = ["Legitimate Windows Defender configuration changes"]
 14from = "now-9m"
 15index = [
 16    "winlogbeat-*",
 17    "logs-endpoint.events.registry-*",
 18    "logs-windows.sysmon_operational-*",
 19    "logs-m365_defender.event-*",
 20    "logs-sentinel_one_cloud_funnel.*",
 21    "endgame-*",
 22]
 23language = "eql"
 24license = "Elastic License v2"
 25name = "Microsoft Windows Defender Tampering"
 26note = """## Triage and analysis
 27
 28### Investigating Microsoft Windows Defender Tampering
 29
 30Microsoft Windows Defender is an antivirus product built into Microsoft Windows, which makes it popular across multiple environments. Disabling it is a common step in threat actor playbooks.
 31
 32This rule monitors the registry for modifications that disable Windows Defender features.
 33
 34#### Possible investigation steps
 35
 36- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 37- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
 38- Identify the user account that performed the action and whether it should perform this kind of action.
 39- Contact the account owner and confirm whether they are aware of this activity.
 40- Investigate other alerts associated with the user/host during the past 48 hours.
 41- Examine which features have been disabled, and check if this operation is done under change management and approved according to the organization's policy.
 42
 43### False positive analysis
 44
 45- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity, the configuration is justified (for example, it is being used to deploy other security solutions or troubleshooting), and no other suspicious activity has been observed.
 46
 47### Related rules
 48
 49- Windows Defender Disabled via Registry Modification - 2ffa1f1e-b6db-47fa-994b-1512743847eb
 50- Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
 51
 52### Response and remediation
 53
 54- Initiate the incident response process based on the outcome of the triage.
 55- Isolate the involved hosts to prevent further post-compromise behavior.
 56- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 57- Take actions to restore the appropriate Windows Defender antivirus configurations.
 58- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 59- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 60- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 61- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 62"""
 63references = [
 64    "https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/",
 65    "https://www.tenforums.com/tutorials/32236-enable-disable-microsoft-defender-pua-protection-windows-10-a.html",
 66    "https://www.tenforums.com/tutorials/104025-turn-off-core-isolation-memory-integrity-windows-10-a.html",
 67    "https://www.tenforums.com/tutorials/105533-enable-disable-windows-defender-exploit-protection-settings.html",
 68    "https://www.tenforums.com/tutorials/123792-turn-off-tamper-protection-microsoft-defender-antivirus.html",
 69    "https://www.tenforums.com/tutorials/51514-turn-off-microsoft-defender-periodic-scanning-windows-10-a.html",
 70    "https://www.tenforums.com/tutorials/3569-turn-off-real-time-protection-microsoft-defender-antivirus.html",
 71    "https://www.tenforums.com/tutorials/99576-how-schedule-scan-microsoft-defender-antivirus-windows-10-a.html",
 72    "https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine",
 73]
 74risk_score = 47
 75rule_id = "fe794edd-487f-4a90-b285-3ee54f2af2d3"
 76severity = "medium"
 77tags = [
 78    "Domain: Endpoint",
 79    "OS: Windows",
 80    "Use Case: Threat Detection",
 81    "Tactic: Defense Evasion",
 82    "Resources: Investigation Guide",
 83    "Data Source: Elastic Defend",
 84    "Data Source: Sysmon",
 85    "Data Source: Microsoft Defender for Endpoint",
 86    "Data Source: SentinelOne",
 87    "Data Source: Elastic Endgame",
 88]
 89timestamp_override = "event.ingested"
 90type = "eql"
 91
 92query = '''
 93registry where host.os.type == "windows" and event.type == "change" and process.executable != null and
 94  (
 95    (
 96      registry.value : (
 97        "PUAProtection", "DisallowExploitProtectionOverride", "TamperProtection", "EnableControlledFolderAccess",
 98        "SpynetReporting", "SubmitSamplesConsent"
 99      ) and registry.data.strings : ("0", "0x00000000")
100    ) or
101    (
102      registry.value : (
103        "DisableAntiSpyware", "DisableRealtimeMonitoring", "DisableIntrusionPreventionSystem", "DisableScriptScanning",
104        "DisableIOAVProtection", "DisableEnhancedNotifications", "DisableBlockAtFirstSeen", "DisableBehaviorMonitoring"
105      ) and registry.data.strings : ("1", "0x00000001")
106    )
107  ) and
108  not process.executable : (
109    "?:\\Windows\\system32\\svchost.exe", 
110    "?:\\Windows\\CCM\\CcmExec.exe", 
111    "?:\\Windows\\System32\\DeviceEnroller.exe", 
112    "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe"
113  )
114
115/*
116    Full registry key paths omitted due to data source variations:
117    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
118    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableRealtimeMonitoring"
119    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIntrusionPreventionSystem"
120    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableScriptScanning"
121    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIOAVProtection"
122    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Reporting\\DisableEnhancedNotifications"
123    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\DisableBlockAtFirstSeen"
124    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableBehaviorMonitoring"
125    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\PUAProtection"
126    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center\\App and Browser protection\\DisallowExploitProtectionOverride"
127    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Features\\TamperProtection"
128    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access\\EnableControlledFolderAccess"
129    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SpynetReporting"
130    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SubmitSamplesConsent"
131*/
132'''
133
134
135[[rule.threat]]
136framework = "MITRE ATT&CK"
137[[rule.threat.technique]]
138id = "T1112"
139name = "Modify Registry"
140reference = "https://attack.mitre.org/techniques/T1112/"
141
142[[rule.threat.technique]]
143id = "T1562"
144name = "Impair Defenses"
145reference = "https://attack.mitre.org/techniques/T1562/"
146
147
148[rule.threat.tactic]
149id = "TA0005"
150name = "Defense Evasion"
151reference = "https://attack.mitre.org/tactics/TA0005/"
...
toml

Microsoft Windows Defender is an antivirus product built into Microsoft Windows, which makes it popular across multiple environments. Disabling it is a common step in threat actor playbooks.

This rule monitors the registry for modifications that disable Windows Defender features.

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Examine which features have been disabled, and check if this operation is done under change management and approved according to the organization's policy.
  • This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity, the configuration is justified (for example, it is being used to deploy other security solutions or troubleshooting), and no other suspicious activity has been observed.
  • Windows Defender Disabled via Registry Modification - 2ffa1f1e-b6db-47fa-994b-1512743847eb
  • Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Take actions to restore the appropriate Windows Defender antivirus configurations.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top