Detection rules › Elastic
Suspicious Windows Defender Registry Modification
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
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\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 | excludes:process.executable |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard value:"1" |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard |