Enable Host Network Discovery via Netsh
Identifies use of the netsh.exe program to enable host discovery via the network. Attackers can use this command-line tool to weaken the host firewall settings.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/07/07"
3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
4maturity = "production"
5updated_date = "2026/05/04"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies use of the netsh.exe program to enable host discovery via the network. Attackers can use this command-line
11tool to weaken the host firewall settings.
12"""
13false_positives = ["Host Windows Firewall planned system administration changes."]
14from = "now-9m"
15index = [
16 "endgame-*",
17 "logs-crowdstrike.fdr*",
18 "logs-endpoint.events.process-*",
19 "logs-m365_defender.event-*",
20 "logs-sentinel_one_cloud_funnel.*",
21 "logs-system.security*",
22 "logs-windows.forwarded*",
23 "logs-windows.sysmon_operational-*",
24 "winlogbeat-*",
25]
26language = "eql"
27license = "Elastic License v2"
28name = "Enable Host Network Discovery via Netsh"
29note = """## Triage and analysis
30
31### Investigating Enable Host Network Discovery via Netsh
32
33The Windows Defender Firewall is a native component that provides host-based, two-way network traffic filtering for a device and blocks unauthorized network traffic flowing into or out of the local device.
34
35Attackers can enable Network Discovery on the Windows firewall to find other systems present in the same network. Systems with this setting enabled will communicate with other systems using broadcast messages, which can be used to identify targets for lateral movement. This rule looks for the setup of this setting using the netsh utility.
36
37#### Possible investigation steps
38
39- 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.
40- Identify the user account that performed the action and whether it should perform this kind of action.
41- Contact the account owner and confirm whether they are aware of this activity.
42- Investigate other alerts associated with the user/host during the past 48 hours.
43- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
44
45### False positive analysis
46
47- This mechanism can be used legitimately. Analysts can dismiss the alert if the Administrator is aware of the activity and there are justifications for this configuration.
48
49### Response and remediation
50
51- Initiate the incident response process based on the outcome of the triage.
52- Isolate the involved hosts to prevent further post-compromise behavior.
53- Disable Network Discovery:
54 - Using netsh: `netsh advfirewall firewall set rule group="Network Discovery" new enable=No`
55- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
56- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
57- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
58- 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).
59"""
60
61setup = """## Setup
62
63This 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.
64
65Setup instructions: https://ela.st/install-elastic-defend
66
67### Additional data sources
68
69This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
70
71- [CrowdStrike](https://ela.st/crowdstrike-integration)
72- [Microsoft Defender XDR](https://ela.st/m365-defender)
73- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
74- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
75- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
76"""
77
78risk_score = 47
79rule_id = "8b4f0816-6a65-4630-86a6-c21c179c0d09"
80severity = "medium"
81tags = [
82 "Domain: Endpoint",
83 "OS: Windows",
84 "Use Case: Threat Detection",
85 "Tactic: Defense Evasion",
86 "Resources: Investigation Guide",
87 "Data Source: Elastic Endgame",
88 "Data Source: Elastic Defend",
89 "Data Source: Windows Security Event Logs",
90 "Data Source: Microsoft Defender XDR",
91 "Data Source: Sysmon",
92 "Data Source: SentinelOne",
93 "Data Source: Crowdstrike",
94]
95timestamp_override = "event.ingested"
96type = "eql"
97
98query = '''
99process where host.os.type == "windows" and event.type == "start" and
100process.name : "netsh.exe" and
101process.args : ("firewall", "advfirewall") and process.args : "group=Network Discovery" and process.args : "enable=Yes"
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1562"
109name = "Impair Defenses"
110reference = "https://attack.mitre.org/techniques/T1562/"
111[[rule.threat.technique.subtechnique]]
112id = "T1562.004"
113name = "Disable or Modify System Firewall"
114reference = "https://attack.mitre.org/techniques/T1562/004/"
115
116
117
118[rule.threat.tactic]
119id = "TA0005"
120name = "Defense Evasion"
121reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Enable Host Network Discovery via Netsh
The Windows Defender Firewall is a native component that 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 enable Network Discovery on the Windows firewall to find other systems present in the same network. Systems with this setting enabled will communicate with other systems using broadcast messages, which can be used to identify targets for lateral movement. This rule looks for the setup of this setting using the netsh utility.
Possible investigation steps
- 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.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
False positive analysis
- This mechanism can be used legitimately. Analysts can dismiss the alert if the Administrator is aware of the activity and there are justifications for this configuration.
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.
- Disable Network Discovery:
- Using netsh:
netsh advfirewall firewall set rule group="Network Discovery" new enable=No
- Using netsh:
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- 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
- Clearing Windows Console History
- Clearing Windows Event Logs
- Code Signing Policy Modification Through Built-in tools
- Command Execution via ForFiles