Detection rules › Splunk

Defender Registry Values Modified (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Adversaries may interact with the Windows Registry to disable security tools to avoid possible detection of their malware/tools and activities. They may interact directly with the registry via command line interpreters or they may abuse system utilities to achieve the same goals, such as SystemSettingsAdminFlows.exe. This use case detects commands for registry modifications targeting Windows Defender capabilities.

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '31402.56381'
title: Defender Registry Values Modified
description: Adversaries may interact with the Windows Registry to disable security
  tools to avoid possible detection of their malware/tools and activities. They may
  interact directly with the registry via command line interpreters or they may abuse
  system utilities to achieve the same goals, such as SystemSettingsAdminFlows.exe.
  This use case detects commands for registry modifications targeting Windows Defender
  capabilities.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) ("cmd.exe" OR "powershell.exe" OR "pwsh.exe")
  "Defender" (("DisableEnhancedNotifications" OR "RTP") "1") OR (("SubmitSamplesConsent"
  OR "SpynetReporting") "0") OR (("Set-ItemProperty" OR "sp " OR "ADD ") ("SOFTWARE\\Microsoft\\Windows
  Defender\\Reporting" OR "SOFTWARE\\Microsoft\\Windows Defender\\Spynet" OR "SOFTWARE\\Microsoft\\Windows
  Defender\\Real-Time Protection"))) OR ((TERM(EventCode=4657) OR "<EventID>4657<")
  ("SOFTWARE\\Microsoft\\Windows Defender\\Reporting" OR "SOFTWARE\\Microsoft\\Windows
  Defender\\Spynet" OR "SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection"))
  | table _time, host, user, process, process_name, registry_* | bin span=1s | stats
  values(*) as * by _time, host '
techniques:
- defense-evasion:modify registry
- defense-evasion:impair defenses:disable or modify tools
technique_id:
- T1112
- T1562.001
data_category:
- Process command-line parameters
- Windows event logs
- Windows Registry
references:
- https://attack.mitre.org/techniques/T1562/001/
- https://attack.mitre.org/techniques/T1112/
- https://www.huntress.com/blog/lolbin-to-inc-ransomware

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ("cmd.exe" OR "powershell.exe" OR "pwsh.exe") "Defender" (("DisableEnhancedNotifications" OR "RTP") "1") OR (("SubmitSamplesConsent" OR "SpynetReporting") "0") OR (("Set-ItemProperty" OR "sp " OR "ADD ") ("SOFTWARE\\Microsoft\\Windows Defender\\Reporting" OR "SOFTWARE\\Microsoft\\Windows Defender\\Spynet" OR "SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection"))) OR ((TERM(EventCode=4657) OR "<EventID>4657<") ("SOFTWARE\\Microsoft\\Windows Defender\\Reporting" OR "SOFTWARE\\Microsoft\\Windows Defender\\Spynet" OR "SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection"))

Stage 2: table

| table _time, host, user, process, process_name, registry_*

Stage 3: bucket

| bin span=1s

Stage 4: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4657 corpus 17 (splunk 14, kusto 3)
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"cmd.exe"
1"powershell.exe"
1"pwsh.exe"
1"Defender"
1"DisableEnhancedNotifications"
1"RTP"
1"1"
1"SubmitSamplesConsent"
1"SpynetReporting"
1"0"
1"Set-ItemProperty"
1"sp "
1"ADD "
1"SOFTWARE\\Microsoft\\Windows Defender\\Reporting"
1"SOFTWARE\\Microsoft\\Windows Defender\\Spynet"
1"SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection"
1"<EventID>4657<"
1"SOFTWARE\\Microsoft\\Windows Defender\\Reporting"
1"SOFTWARE\\Microsoft\\Windows Defender\\Spynet"
1"SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection"