Detection rules › Elastic

Windows Defender Exclusions by Extension

Source
github.com/elastic/protections-artifacts

Identifies modifications to the Windows Defender configuration settings to exclude specific executable file types by extension.

MITRE ATT&CK coverage

TacticTechniques
Defense Impairment

Rule body

[rule]
description = """
Identifies modifications to the Windows Defender configuration settings to exclude specific executable file types by
extension.
"""
id = "bcd02481-8a8a-4b2b-9c29-647bf08b75b2"
license = "Elastic License v2"
name = "Windows Defender Exclusions by Extension"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/powershell/module/defender/add-mppreference?view=windowsserver2019-ps",
]
version = "1.0.13"

query = '''
registry where
 registry.value : ("exe", "pif", "scr", "js", "vbs", "wsh", "hta", "cpl", "jse", "vbe", "bat", "cmd", "dll", "ps?") and
 registry.data.strings : "0" and
 registry.path :
         ("HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Extensions\\*",
          "HKEY_USERS\\S-1-5-21-*\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Extensions\\*") and
 not (process.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
      not process.name : ("reg.exe", "powershell.exe", "rundll32.exe", "regsvr32.exe") and
      not process.executable : "?:\\Windows\\Microsoft.NET\\*")
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: registry

registry where
 registry.value : ("exe", "pif", "scr", "js", "vbs", "wsh", "hta", "cpl", "jse", "vbe", "bat", "cmd", "dll", "ps?") and
 registry.data.strings : "0" and
 registry.path :
         ("HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Extensions\\*",
          "HKEY_USERS\\S-1-5-21-*\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Extensions\\*") and
 not (process.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
      not process.name : ("reg.exe", "powershell.exe", "rundll32.exe", "regsvr32.exe") and
      not process.executable : "?:\\Windows\\Microsoft.NET\\*")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablestarts_with?:\Windows\Microsoft.NET\excludes:process.executable field:"process.executable" value:"?:\Windows\Microsoft.NET\"
process.nameeqreg.exe, powershell.exe, rundll32.exe, regsvr32.exeexcludes:process.name
process.code_signature.statuswildcardtrusted, errorExpired, errorCode_endpoint*excludes:process.code_signature.status field:"process.code_signature.status" value:"trusted" field:"process.code_signature.status" value:"errorExpired" field:"process.code_signature.status" value:"errorCode_endpoint*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.executablewildcard
  • ?:\Windows\Microsoft.NET\* corpus 5 (elastic 5)
field:"Image" kind:wildcard value:"?:\Windows\Microsoft.NET\*"
process.namewildcard
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • reg.exe corpus 27 (elastic 18, splunk 9)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
field:"process_name" kind:wildcard
registry.data.stringswildcard
  • 0 corpus 18 (elastic 15, sigma 3)
field:"Details" kind:wildcard value:"0"
registry.pathwildcard
  • HKEY_USERS\S-1-5-21-*\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions\Extensions\*
  • HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions\Extensions\*
field:"TargetObject" kind:wildcard
registry.valuewildcard
  • bat
  • cmd
  • cpl
  • dll corpus 2 (elastic 2)
  • exe
  • hta
  • js
  • jse
  • pif
  • ps?
  • scr
  • vbe
  • vbs
  • wsh
field:"registry_value_name" kind:wildcard