Detection rules › Elastic

Attempt to Disable Windows Defender Services

Source
github.com/elastic/protections-artifacts

Identifies attempt to stop or disable the Windows Defender services from an unusual parent process.

MITRE ATT&CK coverage

TacticTechniques
Defense Impairment

Rule body

[rule]
description = "Identifies attempt to stop or disable the Windows Defender services from an unusual parent process."
id = "32ab2977-2932-4172-9117-36e382591818"
license = "Elastic License v2"
name = "Attempt to Disable Windows Defender Services"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/luna-ransomware-attack-pattern"]
version = "1.0.28"

query = '''
process where event.action == "start" and
  process.pe.original_file_name : ("net.exe", "sc.exe", "cmd.exe") and
  process.command_line : ("*disabled*", "*stop*") and process.command_line : ("*WdNisSvc*", "*WinDefend*") and
    (process.parent.executable :
                    ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Users\\*",
                     "?:\\ProgramData\\*") or
    process.parent.name : ("rundll32.exe", "regsvr32.exe", "wscript.exe", "cscript.exe", "powershell.exe", "mshta.exe"))
'''

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

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

[[optional_actions]]
action = "rollback"
field = "process.parent.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 = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.pe.original_file_name : ("net.exe", "sc.exe", "cmd.exe") and
  process.command_line : ("*disabled*", "*stop*") and process.command_line : ("*WdNisSvc*", "*WinDefend*") and
    (process.parent.executable :
                    ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Users\\*",
                     "?:\\ProgramData\\*") or
    process.parent.name : ("rundll32.exe", "regsvr32.exe", "wscript.exe", "cscript.exe", "powershell.exe", "mshta.exe"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *WdNisSvc* corpus 2 (sigma 1, elastic 1)
  • *WinDefend* corpus 5 (sigma 3, elastic 1, kusto 1)
  • *disabled* corpus 7 (sigma 5, elastic 1, splunk 1)
  • *stop* corpus 8 (sigma 5, splunk 2, elastic 1)
field:"CommandLine" kind:wildcard
process.parent.executablewildcard
  • ?:\ProgramData\* corpus 2 (elastic 2)
  • ?:\Users\* corpus 2 (elastic 2)
  • ?:\Windows\Microsoft.NET\*
field:"ParentImage" kind:wildcard
process.parent.namewildcard
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • powershell.exe corpus 39 (elastic 36, kusto 2, splunk 1)
  • regsvr32.exe corpus 13 (elastic 13)
  • rundll32.exe corpus 20 (elastic 20)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_name" kind:wildcard
process.pe.original_file_namewildcard
  • cmd.exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • net.exe corpus 31 (sigma 19, elastic 10, splunk 2)
  • sc.exe corpus 30 (sigma 12, splunk 10, elastic 8)
field:"OriginalFileName" kind:wildcard