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"]
4maturity = "production"
5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6min_stack_version = "8.3.0"
7updated_date = "2023/06/22"
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 = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"]
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
57## Setup
58
59If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
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]
74timestamp_override = "event.ingested"
75type = "eql"
76
77query = '''
78registry where host.os.type == "windows" and event.type in ("creation", "change") and
79 (
80 (
81 registry.path: (
82 "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware",
83 "\\REGISTRY\\MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
84 ) and
85 registry.data.strings: ("1", "0x00000001")
86 ) or
87 (
88 registry.path: (
89 "HKLM\\System\\*ControlSet*\\Services\\WinDefend\\Start",
90 "\\REGISTRY\\MACHINE\\System\\*ControlSet*\\Services\\WinDefend\\Start"
91 ) and
92 registry.data.strings in ("3", "4", "0x00000003", "0x00000004")
93 )
94 ) and
95
96 not process.executable :
97 ("?:\\WINDOWS\\system32\\services.exe",
98 "?:\\Windows\\System32\\svchost.exe",
99 "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\NTRmv.exe")
100'''
101
102
103[[rule.threat]]
104framework = "MITRE ATT&CK"
105[[rule.threat.technique]]
106id = "T1562"
107name = "Impair Defenses"
108reference = "https://attack.mitre.org/techniques/T1562/"
109[[rule.threat.technique.subtechnique]]
110id = "T1562.001"
111name = "Disable or Modify Tools"
112reference = "https://attack.mitre.org/techniques/T1562/001/"
113
114[[rule.threat.technique.subtechnique]]
115id = "T1562.006"
116name = "Indicator Blocking"
117reference = "https://attack.mitre.org/techniques/T1562/006/"
118
119
120
121[rule.threat.tactic]
122id = "TA0005"
123name = "Defense Evasion"
124reference = "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).
Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested
and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested
to @timestamp for this rule to work.
References
Related rules
- Adding Hidden File Attribute via Attrib
- Clearing Windows Console History
- Clearing Windows Event Logs
- Code Signing Policy Modification Through Built-in tools
- Code Signing Policy Modification Through Registry