Detection rules › Elastic

Suspicious Windows Defender Registry Modification

Time window
5s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies modifications to the Windows Defender configuration settings via registry changes to disable certain protection features and performed by a suspicious process.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies modifications to the Windows Defender configuration settings via registry changes to disable certain
protection features and performed by a suspicious process.
"""
id = "56751d32-cded-41ad-a273-e6860820c4c3"
license = "Elastic License v2"
name = "Suspicious Windows Defender Registry Modification"
os_list = ["windows"]
version = "1.0.28"

query = '''
sequence by process.entity_id with maxspan=5s
 [registry where
  registry.value :
         ("DisableBehaviorMonitoring",
          "DisableOnAccessProtection",
          "DisableScanOnRealtimeEnable",
          "DisableRealtimeMonitoring",
          "DisableIOAVProtection",
          "DisableRawWriteNotification",
          "DisableScriptScanning",
          "DisableArchiveScanning") and registry.data.strings : "1" and
   (
     /* suspicious paths, common lolbins, unsigned or untrusted file signature */
     process.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\Windows\\Microsoft.NET\\*", "?:\\ProgramData\\*") or
     process.name : ("rundll32.exe", "regsvr32.exe", "cscript.exe", "wscript.exe", "mshta.exe", "msbuild.exe", "powershell.exe") or
     process.code_signature.trusted == false or
     process.code_signature.exists == false
   )
   and not process.executable :
             ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
              "?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
              "*\\Program Files*\\Windows Defender\\MsMpEng.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\ConfigSecurityPolicy.exe")
   ]
   [registry where
    registry.value :
         ("DisableBehaviorMonitoring",
          "DisableOnAccessProtection",
          "DisableScanOnRealtimeEnable",
          "DisableRealtimeMonitoring",
          "DisableIOAVProtection",
          "DisableRawWriteNotification",
          "DisableScriptScanning",
          "DisableArchiveScanning") and registry.data.strings : "1"]
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"

[[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.0.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id.

Stage 1: registry

[registry where
  registry.value :
         ("DisableBehaviorMonitoring",
          "DisableOnAccessProtection",
          "DisableScanOnRealtimeEnable",
          "DisableRealtimeMonitoring",
          "DisableIOAVProtection",
          "DisableRawWriteNotification",
          "DisableScriptScanning",
          "DisableArchiveScanning") and registry.data.strings : "1" and
   (
     process.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\Windows\\Microsoft.NET\\*", "?:\\ProgramData\\*") or
     process.name : ("rundll32.exe", "regsvr32.exe", "cscript.exe", "wscript.exe", "mshta.exe", "msbuild.exe", "powershell.exe") or
     process.code_signature.trusted == false or
     process.code_signature.exists == false
   )
   and not process.executable :
             ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
              "?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
              "*\\Program Files*\\Windows Defender\\MsMpEng.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\ConfigSecurityPolicy.exe")
   ]

Stage 2: registry

[registry where
    registry.value :
         ("DisableBehaviorMonitoring",
          "DisableOnAccessProtection",
          "DisableScanOnRealtimeEnable",
          "DisableRealtimeMonitoring",
          "DisableIOAVProtection",
          "DisableRawWriteNotification",
          "DisableScriptScanning",
          "DisableArchiveScanning") and registry.data.strings : "1"]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, ?:\Program Files\Microsoft Security Client\MsMpEng.exe, *\Program Files*\Windows Defender\MsMpEng.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*\ConfigSecurityPolicy.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.code_signature.existseq
  • false transforms: boolean corpus 119 (elastic 119)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 115 (elastic 115)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\*\AppData\* corpus 12 (elastic 12)
  • ?:\Users\Public\* corpus 4 (elastic 4)
  • ?:\Windows\Microsoft.NET\* corpus 5 (elastic 5)
field:"Image" kind:wildcard
process.namewildcard
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard
registry.data.stringswildcard
  • 1 corpus 20 (elastic 16, splunk 2, kusto 2)
field:"Details" kind:wildcard value:"1"
registry.valuewildcard
  • DisableArchiveScanning corpus 2 (elastic 2)
  • DisableBehaviorMonitoring corpus 2 (elastic 2)
  • DisableIOAVProtection corpus 2 (elastic 2)
  • DisableOnAccessProtection
  • DisableRawWriteNotification
  • DisableRealtimeMonitoring corpus 2 (elastic 2)
  • DisableScanOnRealtimeEnable
  • DisableScriptScanning corpus 2 (elastic 2)
field:"registry_value_name" kind:wildcard