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"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  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-*"]
 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"
 60setup = """## Setup
 61
 62If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 63events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 64Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 65`event.ingested` to @timestamp.
 66For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 67"""
 68severity = "low"
 69tags = [
 70    "Domain: Endpoint",
 71    "OS: Windows",
 72    "Use Case: Threat Detection",
 73    "Tactic: Defense Evasion",
 74    "Resources: Investigation Guide",
 75    "Data Source: Elastic Endgame",
 76    "Data Source: Elastic Defend",
 77    "Data Source: Sysmon"
 78]
 79timestamp_override = "event.ingested"
 80type = "eql"
 81
 82query = '''
 83registry where host.os.type == "windows" and event.type in ("creation", "change") and
 84  (
 85    (
 86      registry.path: (
 87        "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware",
 88        "\\REGISTRY\\MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
 89      ) and
 90      registry.data.strings: ("1", "0x00000001")
 91   ) or
 92   (
 93      registry.path: (
 94        "HKLM\\System\\*ControlSet*\\Services\\WinDefend\\Start",
 95        "\\REGISTRY\\MACHINE\\System\\*ControlSet*\\Services\\WinDefend\\Start"
 96      ) and
 97      registry.data.strings in ("3", "4", "0x00000003", "0x00000004")
 98   )
 99  ) and
100
101  not
102    (
103      process.executable : (
104          "?:\\WINDOWS\\system32\\services.exe",
105          "?:\\Windows\\System32\\svchost.exe",
106          "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\NTRmv.exe"
107      ) and user.id : "S-1-5-18"
108    )
109'''
110
111
112[[rule.threat]]
113framework = "MITRE ATT&CK"
114[[rule.threat.technique]]
115id = "T1562"
116name = "Impair Defenses"
117reference = "https://attack.mitre.org/techniques/T1562/"
118[[rule.threat.technique.subtechnique]]
119id = "T1562.001"
120name = "Disable or Modify Tools"
121reference = "https://attack.mitre.org/techniques/T1562/001/"
122
123[[rule.threat.technique.subtechnique]]
124id = "T1562.006"
125name = "Indicator Blocking"
126reference = "https://attack.mitre.org/techniques/T1562/006/"
127
128[[rule.threat.technique]]
129id = "T1112"
130name = "Modify Registry"
131reference = "https://attack.mitre.org/techniques/T1112/"
132
133
134[rule.threat.tactic]
135id = "TA0005"
136name = "Defense Evasion"
137reference = "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.
  • 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

to-top