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 = "2024/10/31"
6min_stack_version = "8.14.0"
7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies use of the netsh.exe program to enable host discovery via the network. Attackers can use this command-line
13tool to weaken the host firewall settings.
14"""
15false_positives = ["Host Windows Firewall planned system administration changes."]
16from = "now-9m"
17index = [
18 "winlogbeat-*",
19 "logs-endpoint.events.process-*",
20 "logs-windows.forwarded*",
21 "logs-windows.sysmon_operational-*",
22 "endgame-*",
23 "logs-system.security*",
24 "logs-m365_defender.event-*",
25 "logs-sentinel_one_cloud_funnel.*",
26 "logs-crowdstrike.fdr*",
27]
28language = "eql"
29license = "Elastic License v2"
30name = "Enable Host Network Discovery via Netsh"
31note = """## Triage and analysis
32
33### Investigating Enable Host Network Discovery via Netsh
34
35The 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.
36
37Attackers 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.
38
39#### Possible investigation steps
40
41- 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.
42- Identify the user account that performed the action and whether it should perform this kind of action.
43- Contact the account owner and confirm whether they are aware of this activity.
44- Investigate other alerts associated with the user/host during the past 48 hours.
45- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
46
47### False positive analysis
48
49- 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.
50
51### Response and remediation
52
53- Initiate the incident response process based on the outcome of the triage.
54- Isolate the involved hosts to prevent further post-compromise behavior.
55- Disable Network Discovery:
56 - Using netsh: `netsh advfirewall firewall set rule group="Network Discovery" new enable=No`
57- 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.
58- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
59- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
60- 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).
61"""
62risk_score = 47
63rule_id = "8b4f0816-6a65-4630-86a6-c21c179c0d09"
64severity = "medium"
65tags = [
66 "Domain: Endpoint",
67 "OS: Windows",
68 "Use Case: Threat Detection",
69 "Tactic: Defense Evasion",
70 "Resources: Investigation Guide",
71 "Data Source: Elastic Endgame",
72 "Data Source: Elastic Defend",
73 "Data Source: System",
74 "Data Source: Microsoft Defender for Endpoint",
75 "Data Source: Sysmon",
76 "Data Source: SentinelOne",
77 "Data Source: Crowdstrike",
78]
79timestamp_override = "event.ingested"
80type = "eql"
81
82query = '''
83process where host.os.type == "windows" and event.type == "start" and
84process.name : "netsh.exe" and
85process.args : ("firewall", "advfirewall") and process.args : "group=Network Discovery" and process.args : "enable=Yes"
86'''
87
88
89[[rule.threat]]
90framework = "MITRE ATT&CK"
91[[rule.threat.technique]]
92id = "T1562"
93name = "Impair Defenses"
94reference = "https://attack.mitre.org/techniques/T1562/"
95[[rule.threat.technique.subtechnique]]
96id = "T1562.004"
97name = "Disable or Modify System Firewall"
98reference = "https://attack.mitre.org/techniques/T1562/004/"
99
100
101
102[rule.threat.tactic]
103id = "TA0005"
104name = "Defense Evasion"
105reference = "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
- Microsoft Build Engine Started by an Office Application
- Disable Windows Firewall Rules via Netsh
- Attempt to Install Kali Linux via WSL
- Control Panel Process with Unusual Arguments
- Microsoft Build Engine Started by a System Process