Microsoft Windows Defender Tampering

edit

Identifies when one or more features on Microsoft Defender are disabled. Adversaries may disable or tamper with Microsoft Defender features to evade detection and conceal malicious behavior.

Rule type: eql

Rule indices:

  • winlogbeat-*
  • logs-endpoint.events.*
  • logs-windows.*

Severity: medium

Risk score: 47

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Defense Evasion

Version: 3 (version history)

Added (Elastic Stack release): 8.0.0

Last modified (Elastic Stack release): 8.2.0

Rule authors: Austin Songer

Rule license: Elastic License v2

Potential false positives

edit

Legitimate Windows Defender configuration changes

Investigation guide

edit
## Config

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.

Rule query

edit
registry where event.type in ("creation", "change") and
(registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\PUAProtection" and registry.data.strings : ("0",
"0x00000000")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security
Center\\App and Browser protection\\DisallowExploitProtectionOverride"
and registry.data.strings : ("0", "0x00000000")) or (registry.path
: "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\DisableAntiSpyware" and registry.data.strings : ("1",
"0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\Features\\TamperProtection" and registry.data.strings :
("0", "0x00000000")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
Protection\\DisableRealtimeMonitoring" and registry.data.strings :
("1", "0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
Protection\\DisableIntrusionPreventionSystem" and
registry.data.strings : ("1", "0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
Protection\\DisableScriptScanning" and registry.data.strings : ("1",
"0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows
Defender Exploit Guard\\Controlled Folder
Access\\EnableControlledFolderAccess" and registry.data.strings :
("0", "0x00000000")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
Protection\\DisableIOAVProtection" and registry.data.strings : ("1",
"0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\Reporting\\DisableEnhancedNotifications" and
registry.data.strings : ("1", "0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\SpyNet\\DisableBlockAtFirstSeen" and registry.data.strings
: ("1", "0x00000001")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\SpyNet\\SpynetReporting" and registry.data.strings : ("0",
"0x00000000")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
Defender\\SpyNet\\SubmitSamplesConsent" and registry.data.strings :
("0", "0x00000000")) or (registry.path :
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
Protection\\DisableBehaviorMonitoring" and registry.data.strings :
("1", "0x00000001"))

Threat mapping

edit

Framework: MITRE ATT&CKTM

Rule version history

edit
Version 3 (8.2.0 release)
  • Updated query, changed from:

    registry where event.type in ("creation", "change") and
    (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\PUAProtection" and registry.data.strings : ("0",
    "0x00000000")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security
    Center\\App and Browser protection\\DisallowExploitProtectionOverride"
    and registry.data.strings : ("1", "0x00000001")) or (registry.path
    : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\DisableAntiSpyware" and registry.data.strings : ("1",
    "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\Features\\TamperProtection" and registry.data.strings :
    ("0", "0x00000000")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableRealtimeMonitoring" and registry.data.strings :
    ("1", "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableIntrusionPreventionSystem" and
    registry.data.strings : ("1", "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableScriptScanning" and registry.data.strings : ("1",
    "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows
    Defender Exploit Guard\\Controlled Folder
    Access\\EnableControlledFolderAccess" and registry.data.strings :
    ("0", "0x00000000")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableIOAVProtection" and registry.data.strings : ("1",
    "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\Reporting\\DisableEnhancedNotifications" and
    registry.data.strings : ("1", "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\DisableBlockAtFirstSeen" and registry.data.strings
    : ("1", "0x00000001")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\SpynetReporting" and registry.data.strings : ("0",
    "0x00000000")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\SubmitSamplesConsent" and registry.data.strings :
    ("0", "0x00000000")) or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableBehaviorMonitoring" and registry.data.strings :
    ("1", "0x00000001"))
Version 2 (8.1.0 release)
  • Updated query, changed from:

    registry where event.type in ("creation", "change") and
    (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\PUAProtection" and registry.data.strings : "0") or
    (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender Security Center\\App and Browser
    protection\\DisallowExploitProtectionOverride" and
    registry.data.strings : "1") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\DisableAntiSpyware" and registry.data.strings : "1") or
    (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\Features\\TamperProtection" and registry.data.strings :
    "0") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableRealtimeMonitoring" and registry.data.strings :
    "1") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableIntrusionPreventionSystem" and
    registry.data.strings : "1") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableScriptScanning" and registry.data.strings : "1")
    or (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\Windows Defender Exploit Guard\\Controlled Folder
    Access\\EnableControlledFolderAccess" and registry.data.strings :
    "0") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableIOAVProtection" and registry.data.strings : "1")
    or (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\Reporting\\DisableEnhancedNotifications" and
    registry.data.strings : "1") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\DisableBlockAtFirstSeen" and registry.data.strings
    : "1") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\SpynetReporting" and registry.data.strings : "0")
    or (registry.path : "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows
    Defender\\SpyNet\\SubmitSamplesConsent" and registry.data.strings :
    "0") or (registry.path :
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time
    Protection\\DisableBehaviorMonitoring" and registry.data.strings :
    "1")