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