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", "crowdstrike"]
  4maturity = "production"
  5updated_date = "2026/05/04"
  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    "logs-crowdstrike.fdr*",
 23]
 24language = "eql"
 25license = "Elastic License v2"
 26name = "Microsoft Windows Defender Tampering"
 27note = """## Triage and analysis
 28
 29### Investigating Microsoft Windows Defender Tampering
 30
 31Microsoft 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.
 32
 33This rule monitors the registry for modifications that disable Windows Defender features.
 34
 35#### Possible investigation steps
 36
 37- 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.
 38- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
 39- Identify the user account that performed the action and whether it should perform this kind of action.
 40- Contact the account owner and confirm whether they are aware of this activity.
 41- Investigate other alerts associated with the user/host during the past 48 hours.
 42- Examine which features have been disabled, and check if this operation is done under change management and approved according to the organization's policy.
 43
 44### False positive analysis
 45
 46- 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.
 47
 48### Related rules
 49
 50- Windows Defender Disabled via Registry Modification - 2ffa1f1e-b6db-47fa-994b-1512743847eb
 51- Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
 52
 53### Response and remediation
 54
 55- Initiate the incident response process based on the outcome of the triage.
 56- Isolate the involved hosts to prevent further post-compromise behavior.
 57- 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.
 58- Take actions to restore the appropriate Windows Defender antivirus configurations.
 59- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 60- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 61- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 62- 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).
 63"""
 64
 65setup = """## Setup
 66
 67This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
 68
 69Setup instructions: https://ela.st/install-elastic-defend
 70
 71### Additional data sources
 72
 73This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
 74
 75- [CrowdStrike](https://ela.st/crowdstrike-integration)
 76- [Microsoft Defender XDR](https://ela.st/m365-defender)
 77- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
 78- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
 79"""
 80
 81references = [
 82    "https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/",
 83    "https://www.tenforums.com/tutorials/32236-enable-disable-microsoft-defender-pua-protection-windows-10-a.html",
 84    "https://www.tenforums.com/tutorials/104025-turn-off-core-isolation-memory-integrity-windows-10-a.html",
 85    "https://www.tenforums.com/tutorials/105533-enable-disable-windows-defender-exploit-protection-settings.html",
 86    "https://www.tenforums.com/tutorials/123792-turn-off-tamper-protection-microsoft-defender-antivirus.html",
 87    "https://www.tenforums.com/tutorials/51514-turn-off-microsoft-defender-periodic-scanning-windows-10-a.html",
 88    "https://www.tenforums.com/tutorials/3569-turn-off-real-time-protection-microsoft-defender-antivirus.html",
 89    "https://www.tenforums.com/tutorials/99576-how-schedule-scan-microsoft-defender-antivirus-windows-10-a.html",
 90    "https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine",
 91]
 92risk_score = 47
 93rule_id = "fe794edd-487f-4a90-b285-3ee54f2af2d3"
 94severity = "medium"
 95tags = [
 96    "Domain: Endpoint",
 97    "OS: Windows",
 98    "Use Case: Threat Detection",
 99    "Tactic: Defense Evasion",
100    "Resources: Investigation Guide",
101    "Data Source: Elastic Defend",
102    "Data Source: Sysmon",
103    "Data Source: Microsoft Defender XDR",
104    "Data Source: SentinelOne",
105    "Data Source: Elastic Endgame",
106    "Data Source: Crowdstrike",
107]
108timestamp_override = "event.ingested"
109type = "eql"
110
111query = '''
112registry where host.os.type == "windows" and event.type == "change" and process.executable != null and
113  (
114    (
115      registry.value : (
116        "PUAProtection", "DisallowExploitProtectionOverride", "TamperProtection", "EnableControlledFolderAccess",
117        "SpynetReporting", "SubmitSamplesConsent"
118      ) and registry.data.strings : ("0", "0x00000000")
119    ) or
120    (
121      registry.value : (
122        "DisableAntiSpyware", "DisableRealtimeMonitoring", "DisableIntrusionPreventionSystem", "DisableScriptScanning",
123        "DisableIOAVProtection", "DisableEnhancedNotifications", "DisableBlockAtFirstSeen", "DisableBehaviorMonitoring"
124      ) and registry.data.strings : ("1", "0x00000001")
125    )
126  ) and
127  not process.executable : (
128    "?:\\Windows\\system32\\svchost.exe", 
129    "?:\\Windows\\CCM\\CcmExec.exe", 
130    "?:\\Windows\\System32\\DeviceEnroller.exe", 
131    "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe",
132    "\\Device\\HarddiskVolume*\\Windows\\system32\\svchost.exe", 
133    "\\Device\\HarddiskVolume*\\Windows\\CCM\\CcmExec.exe", 
134    "\\Device\\HarddiskVolume*\\Windows\\System32\\DeviceEnroller.exe", 
135    "\\Device\\HarddiskVolume*\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe"
136  )
137
138/*
139    Full registry key paths omitted due to data source variations:
140    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
141    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableRealtimeMonitoring"
142    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIntrusionPreventionSystem"
143    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableScriptScanning"
144    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIOAVProtection"
145    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Reporting\\DisableEnhancedNotifications"
146    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\DisableBlockAtFirstSeen"
147    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableBehaviorMonitoring"
148    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\PUAProtection"
149    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center\\App and Browser protection\\DisallowExploitProtectionOverride"
150    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Features\\TamperProtection"
151    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access\\EnableControlledFolderAccess"
152    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SpynetReporting"
153    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SubmitSamplesConsent"
154*/
155'''
156
157
158[[rule.threat]]
159framework = "MITRE ATT&CK"
160
161[[rule.threat.technique]]
162id = "T1112"
163name = "Modify Registry"
164reference = "https://attack.mitre.org/techniques/T1112/"
165
166[[rule.threat.technique]]
167id = "T1562"
168name = "Impair Defenses"
169reference = "https://attack.mitre.org/techniques/T1562/"
170
171[[rule.threat.technique.subtechnique]]
172id = "T1562.001"
173name = "Disable or Modify Tools"
174reference = "https://attack.mitre.org/techniques/T1562/001/"
175
176[rule.threat.tactic]
177id = "TA0005"
178name = "Defense Evasion"
179reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Microsoft Windows Defender Tampering

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.

Possible investigation steps

  • 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.

False positive analysis

  • 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

Response and remediation

  • 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