Detection rules › Elastic

Defense Evasion via Registry Modification

Source
github.com/elastic/protections-artifacts

Identifies modifications to some Windows security related configurations settings via registry changes to disable certain protection or hardening features and performed by a suspicious process.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies modifications to some Windows security related configurations settings via registry changes to disable
certain protection or hardening features and performed by a suspicious process.
"""
id = "e3938d6e-8f66-4871-88c7-442a530f8119"
license = "Elastic License v2"
name = "Defense Evasion via Registry Modification"
os_list = ["windows"]
version = "1.0.23"

query = '''
registry where not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and

 (process.code_signature.exists == false or
  process.name : ("powershell.exe", "reg.exe", "cscript.exe", "wscript.exe", "mshta.exe", "winword.exe", "excel.exe") or
  process.executable : ("?:\\Windows\\Microsoft.NET\\*", "?:\\Users\\Public\\*", "?:\\Users\\*\\AppData\\*")) and

 registry.path : ("HK*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\*") and

 (
   (registry.value : ("EnableUA", "ConsentPromptBehaviorAdmin", "PromptOnSecureDesktop") and registry.data.strings : "0") or

   (registry.value : ("DisableTaskMgr", "DisableRegistryTools", "DisableArchiveScanning") and registry.data.strings : "1") or

    registry.value : "DisableCMD" or

    (registry.path : "HKEY_USERS\\*\\Software\\Microsoft\\Windows\\CurrentVersion\\Notifications\\Settings\\Windows.SystemToast.SecurityAndMaintenance\\Enabled" and
     registry.data.strings : "0")
 ) and
 not (registry.value : "DisableTaskMgr" and
      process.executable : ("?:\\Program Files (x86)\\Green's MCI\\MCI.exe",
                            "?:\\Program Files (x86)\\Green's NV-MSVT\\NV-MSVT.exe",
                            "?:\\Program Files (x86)\\Green's MSVT\\MSVT.exe")) and
 not (process.code_signature.subject_name : ("Barco N.V.", "Advantig Corporation") and process.code_signature.trusted == true)
'''

min_endpoint_version = "8.1.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 = "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.1.0"

Stages and Predicates

Stage 1: registry

registry where not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and

 (process.code_signature.exists == false or
  process.name : ("powershell.exe", "reg.exe", "cscript.exe", "wscript.exe", "mshta.exe", "winword.exe", "excel.exe") or
  process.executable : ("?:\\Windows\\Microsoft.NET\\*", "?:\\Users\\Public\\*", "?:\\Users\\*\\AppData\\*")) and

 registry.path : ("HK*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\*") and

 (
   (registry.value : ("EnableUA", "ConsentPromptBehaviorAdmin", "PromptOnSecureDesktop") and registry.data.strings : "0") or

   (registry.value : ("DisableTaskMgr", "DisableRegistryTools", "DisableArchiveScanning") and registry.data.strings : "1") or

    registry.value : "DisableCMD" or

    (registry.path : "HKEY_USERS\\*\\Software\\Microsoft\\Windows\\CurrentVersion\\Notifications\\Settings\\Windows.SystemToast.SecurityAndMaintenance\\Enabled" and
     registry.data.strings : "0")
 ) and
 not (registry.value : "DisableTaskMgr" and
      process.executable : ("?:\\Program Files (x86)\\Green's MCI\\MCI.exe",
                            "?:\\Program Files (x86)\\Green's NV-MSVT\\NV-MSVT.exe",
                            "?:\\Program Files (x86)\\Green's MSVT\\MSVT.exe")) and
 not (process.code_signature.subject_name : ("Barco N.V.", "Advantig Corporation") and process.code_signature.trusted == true)

Exclusions

The rule actively suppresses these predicates.

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.executablewildcard
  • ?:\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)
  • excel.exe corpus 34 (elastic 34)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • reg.exe corpus 27 (elastic 18, splunk 9)
  • winword.exe corpus 35 (elastic 35)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard
registry.data.stringswildcard
  • 0 corpus 18 (elastic 15, sigma 3)
  • 1 corpus 20 (elastic 16, splunk 2, kusto 2)
field:"Details" kind:wildcard
registry.pathwildcard
  • HK*\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\*
  • HKEY_USERS\*\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance\Enabled
field:"TargetObject" kind:wildcard
registry.valuewildcard
  • ConsentPromptBehaviorAdmin corpus 3 (elastic 2, splunk 1)
  • DisableArchiveScanning corpus 2 (elastic 2)
  • DisableCMD
  • DisableRegistryTools
  • DisableTaskMgr
  • EnableUA
  • PromptOnSecureDesktop corpus 2 (elastic 2)
field:"registry_value_name" kind:wildcard