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