Disable Windows Firewall Rules via Netsh
Identifies use of the netsh.exe to disable or weaken the local firewall. Attackers will use this command line tool to disable the firewall during troubleshooting or to enable network mobility.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/02/18"
3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
4maturity = "production"
5updated_date = "2026/09/18"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies use of the netsh.exe to disable or weaken the local firewall. Attackers will use this command line tool to
11disable the firewall during troubleshooting or to enable network mobility.
12"""
13from = "now-9m"
14index = [
15 "endgame-*",
16 "logs-crowdstrike.fdr*",
17 "logs-endpoint.events.process-*",
18 "logs-m365_defender.event-*",
19 "logs-sentinel_one_cloud_funnel.*",
20 "logs-system.security*",
21 "logs-windows.forwarded*",
22 "logs-windows.sysmon_operational-*",
23 "winlogbeat-*",
24]
25language = "eql"
26license = "Elastic License v2"
27name = "Disable Windows Firewall Rules via Netsh"
28note = """## Triage and analysis
29
30### Investigating Disable Windows Firewall Rules via Netsh
31
32The Windows Defender Firewall is a native component which provides host-based, two-way network traffic filtering for a device, and blocks unauthorized network traffic flowing into or out of the local device.
33
34Attackers can disable the Windows firewall or its rules to enable lateral movement and command and control activity.
35
36This rule identifies patterns related to disabling the Windows firewall or its rules using the `netsh.exe` utility.
37
38#### Possible investigation steps
39
40- Identify the user account that performed the action and whether it should perform this kind of action.
41- Contact the user to check if they are aware of the operation.
42- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
43- Investigate other alerts associated with the user/host during the past 48 hours.
44
45### False positive analysis
46
47- This mechanism can be used legitimately. Check whether the user is an administrator and is legitimately performing troubleshooting.
48- In case of an allowed benign true positive (B-TP), assess adding rules to allow needed traffic and re-enable the firewall.
49
50### Response and remediation
51
52- Initiate the incident response process based on the outcome of the triage.
53- Isolate the involved hosts to prevent further post-compromise behavior.
54- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
55- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
56- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
57"""
58
59setup = """## Setup
60
61This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
62
63Setup instructions: https://ela.st/install-elastic-defend
64
65### Additional data sources
66
67This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
68
69- [CrowdStrike](https://ela.st/crowdstrike-integration)
70- [Microsoft Defender XDR](https://ela.st/m365-defender)
71- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
72- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
73- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
74"""
75
76risk_score = 47
77rule_id = "4b438734-3793-4fda-bd42-ceeada0be8f9"
78severity = "medium"
79tags = [
80 "Domain: Endpoint",
81 "OS: Windows",
82 "Use Case: Threat Detection",
83 "Tactic: Defense Evasion",
84 "Resources: Investigation Guide",
85 "Data Source: Elastic Endgame",
86 "Data Source: Elastic Defend",
87 "Data Source: Windows Security Event Logs",
88 "Data Source: Microsoft Defender XDR",
89 "Data Source: Sysmon",
90 "Data Source: SentinelOne",
91 "Data Source: Crowdstrike",
92 "Noise: Medium",
93 "Performance: Normal",
94 "Rule Type: Event Correlation (EQL)",
95 "Platform: Windows",
96]
97timestamp_override = "event.ingested"
98type = "eql"
99
100query = '''
101process where host.os.type == "windows" and event.type == "start" and
102 process.name : "netsh.exe" and
103 (
104 (process.args : "disable" and process.args : "firewall" and process.args : "set") or
105 (process.args : "advfirewall" and process.args : "off" and process.args : "state")
106 )
107'''
108
109
110[[rule.threat]]
111framework = "MITRE ATT&CK"
112[[rule.threat.technique]]
113id = "T1562"
114name = "Impair Defenses"
115reference = "https://attack.mitre.org/techniques/T1562/"
116[[rule.threat.technique.subtechnique]]
117id = "T1562.004"
118name = "Disable or Modify System Firewall"
119reference = "https://attack.mitre.org/techniques/T1562/004/"
120
121
122
123[rule.threat.tactic]
124id = "TA0005"
125name = "Defense Evasion"
126reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Disable Windows Firewall Rules via Netsh
The Windows Defender Firewall is a native component which provides host-based, two-way network traffic filtering for a device, and blocks unauthorized network traffic flowing into or out of the local device.
Attackers can disable the Windows firewall or its rules to enable lateral movement and command and control activity.
This rule identifies patterns related to disabling the Windows firewall or its rules using the netsh.exe utility.
Possible investigation steps
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the user to check if they are aware of the operation.
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
False positive analysis
- This mechanism can be used legitimately. Check whether the user is an administrator and is legitimately performing troubleshooting.
- In case of an allowed benign true positive (B-TP), assess adding rules to allow needed traffic and re-enable the firewall.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
Related rules
- Adding Hidden File Attribute via Attrib
- Attempt to Install or Run Kali Linux via WSL
- Clearing Windows Console History
- Command Execution via ForFiles
- Command Obfuscation via Unicode Modifier Letters