Windows Defender Disabled via Registry Modification

Identifies modifications to the Windows Defender registry settings to disable the service or set the service to be started manually.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/12/23"
  3integration = ["endpoint", "windows", "m365_defender"]
  4maturity = "production"
  5updated_date = "2025/03/20"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies modifications to the Windows Defender registry settings to disable the service or set the service to be
 11started manually.
 12"""
 13from = "now-9m"
 14index = [
 15    "logs-endpoint.events.registry-*",
 16    "endgame-*",
 17    "logs-windows.sysmon_operational-*",
 18    "winlogbeat-*",
 19    "logs-m365_defender.event-*",
 20]
 21language = "eql"
 22license = "Elastic License v2"
 23name = "Windows Defender Disabled via Registry Modification"
 24note = """## Triage and analysis
 25
 26### Investigating Windows Defender Disabled via Registry Modification
 27
 28Microsoft 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.
 29
 30This rule monitors the registry for configurations that disable Windows Defender or the start of its service.
 31
 32#### Possible investigation steps
 33
 34- 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.
 35- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
 36- Identify the user account that performed the action and whether it should perform this kind of action.
 37- Contact the account owner and confirm whether they are aware of this activity.
 38- Investigate other alerts associated with the user/host during the past 48 hours.
 39- Check if this operation was approved and performed according to the organization's change management policy.
 40
 41### False positive analysis
 42
 43- 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.
 44
 45### Related rules
 46
 47- Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
 48- Microsoft Windows Defender Tampering - fe794edd-487f-4a90-b285-3ee54f2af2d3
 49
 50### Response and remediation
 51
 52- Initiate the incident response process based on the outcome of the triage.
 53- Isolate the involved hosts to prevent further post-compromise behavior.
 54- 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.
 55- Re-enable Windows Defender and restore the service configurations to automatic start.
 56- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 57- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 58- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 59- 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).
 60"""
 61references = ["https://thedfirreport.com/2020/12/13/defender-control/"]
 62risk_score = 21
 63rule_id = "2ffa1f1e-b6db-47fa-994b-1512743847eb"
 64severity = "low"
 65tags = [
 66    "Domain: Endpoint",
 67    "OS: Windows",
 68    "Use Case: Threat Detection",
 69    "Tactic: Defense Evasion",
 70    "Resources: Investigation Guide",
 71    "Data Source: Elastic Endgame",
 72    "Data Source: Elastic Defend",
 73    "Data Source: Sysmon",
 74    "Data Source: Microsoft Defender for Endpoint",
 75]
 76timestamp_override = "event.ingested"
 77type = "eql"
 78
 79query = '''
 80registry where host.os.type == "windows" and event.type == "change" and
 81  (
 82    (
 83      registry.path: (
 84        "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware",
 85        "\\REGISTRY\\MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
 86      ) and
 87      registry.data.strings: ("1", "0x00000001")
 88   ) or
 89   (
 90      registry.path: (
 91        "HKLM\\System\\*ControlSet*\\Services\\WinDefend\\Start",
 92        "\\REGISTRY\\MACHINE\\System\\*ControlSet*\\Services\\WinDefend\\Start"
 93      ) and
 94      registry.data.strings in ("3", "4", "0x00000003", "0x00000004")
 95   )
 96  ) and
 97
 98  not
 99    (
100      process.executable : (
101          "?:\\WINDOWS\\system32\\services.exe",
102          "?:\\Windows\\System32\\svchost.exe",
103          "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\NTRmv.exe"
104      ) and user.id : "S-1-5-18"
105    )
106'''
107
108
109[[rule.threat]]
110framework = "MITRE ATT&CK"
111[[rule.threat.technique]]
112id = "T1112"
113name = "Modify Registry"
114reference = "https://attack.mitre.org/techniques/T1112/"
115
116[[rule.threat.technique]]
117id = "T1562"
118name = "Impair Defenses"
119reference = "https://attack.mitre.org/techniques/T1562/"
120[[rule.threat.technique.subtechnique]]
121id = "T1562.001"
122name = "Disable or Modify Tools"
123reference = "https://attack.mitre.org/techniques/T1562/001/"
124
125[[rule.threat.technique.subtechnique]]
126id = "T1562.006"
127name = "Indicator Blocking"
128reference = "https://attack.mitre.org/techniques/T1562/006/"
129
130
131
132[rule.threat.tactic]
133id = "TA0005"
134name = "Defense Evasion"
135reference = "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 configurations that disable Windows Defender or the start of its service.

  • 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.
  • Check if this operation was approved and performed according to the organization's change management 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.
  • Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
  • Microsoft Windows Defender Tampering - fe794edd-487f-4a90-b285-3ee54f2af2d3
  • 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.
  • Re-enable Windows Defender and restore the service configurations to automatic start.
  • 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