Detection rules › Elastic
Windows Firewall Exception List Modified via Untrusted Process
Identifies the execution of the built-in Windows program, Netsh, to add a program to the Windows Firewall exception list via an untrusted parent process.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule body
[rule]
description = """
Identifies the execution of the built-in Windows program, Netsh, to add a program to the Windows Firewall exception list
via an untrusted parent process.
"""
id = "5c01669c-e1cc-4acc-95b6-8b5e4a92c970"
license = "Elastic License v2"
name = "Windows Firewall Exception List Modified via Untrusted Process"
os_list = ["windows"]
reference = [
"https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior",
]
version = "1.0.33"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and
process.executable : ("?:\\ProgramData\\*", "?:\\Users\\*", "?:\\Python*") and not process.code_signature.trusted == true] by process.entity_id
[process where event.action == "start" and process.name : "netsh.exe" and
process.command_line : "*add*allowedprogram*ENABLE*" and
not process.args : ("program=*:\\Program Files\\*", "program=*:\\Program Files (x86)\\*") and
not (process.args : "name=Free Download Manager" and process.parent.name : "fdm_x64_setup.tmp")
] by process.parent.entity_id
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.004"
name = "Disable or Modify System Firewall"
reference = "https://attack.mitre.org/techniques/T1562/004/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and
process.executable : ("?:\\ProgramData\\*", "?:\\Users\\*", "?:\\Python*") and not process.code_signature.trusted == true] by process.entity_id
Stage 2: process
[process where event.action == "start" and process.name : "netsh.exe" and
process.command_line : "*add*allowedprogram*ENABLE*" and
not process.args : ("program=*:\\Program Files\\*", "program=*:\\Program Files (x86)\\*") and
not (process.args : "name=Free Download Manager" and process.parent.name : "fdm_x64_setup.tmp")
] by process.parent.entity_id
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.args | eq | name=Free Download Manager | excludes:process.args field:"process.args" value:"name=Free Download Manager" |
process.parent.name | eq | fdm_x64_setup.tmp | excludes:process.parent.name field:"process.parent.name" value:"fdm_x64_setup.tmp" |
process.args | wildcard | program=*:\Program Files\*, program=*:\Program Files (x86)\* | excludes:process.args field:"process.args" value:"program=*:\Program Files\*" field:"process.args" value:"program=*:\Program Files (x86)\*" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*add*allowedprogram*ENABLE*" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"netsh.exe" |