Remote Desktop Enabled in Windows Firewall by Netsh
Identifies use of the network shell utility (netsh.exe) to enable inbound Remote Desktop Protocol (RDP) connections in the Windows Firewall.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/10/13"
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 network shell utility (netsh.exe) to enable inbound Remote Desktop Protocol (RDP) connections in
11the Windows Firewall.
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 = "Remote Desktop Enabled in Windows Firewall by Netsh"
28note = """## Triage and analysis
29
30### Investigating Remote Desktop Enabled in Windows Firewall by Netsh
31
32Microsoft Remote Desktop Protocol (RDP) is a proprietary Microsoft protocol that enables remote connections to other computers, typically over TCP port 3389.
33
34Attackers can use RDP to conduct their actions interactively. Ransomware operators frequently use RDP to access victim servers, often using privileged accounts.
35
36This rule detects the creation of a Windows Firewall inbound rule that would allow inbound RDP traffic 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- Check whether it makes sense to enable RDP to this host, given its role in the environment.
45- Check if the host is directly exposed to the internet.
46- Check whether privileged accounts accessed the host shortly after the modification.
47- Review network events within a short timespan of this alert for incoming RDP connection attempts.
48
49### False positive analysis
50
51- The `netsh.exe` utility can be used legitimately. Check whether the user should be performing this kind of activity, whether the user is aware of it, whether RDP should be open, and whether the action exposes the environment to unnecessary risks.
52
53### Response and remediation
54
55- Initiate the incident response process based on the outcome of the triage.
56- If RDP is needed, make sure to secure it:
57 - Allowlist RDP traffic to specific trusted hosts.
58 - Restrict RDP logins to authorized non-administrator accounts, where possible.
59- Isolate the involved hosts to prevent further post-compromise behavior.
60- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
61- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
62- 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).
63"""
64
65setup = """## Setup
66
67This 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.
68
69Setup instructions: https://ela.st/install-elastic-defend
70
71### Additional data sources
72
73This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
74
75- [CrowdStrike](https://ela.st/crowdstrike-integration)
76- [Microsoft Defender XDR](https://ela.st/m365-defender)
77- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
78- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
79- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
80"""
81
82risk_score = 47
83rule_id = "074464f9-f30d-4029-8c03-0ed237fffec7"
84severity = "medium"
85tags = [
86 "Domain: Endpoint",
87 "OS: Windows",
88 "Use Case: Threat Detection",
89 "Tactic: Defense Evasion",
90 "Resources: Investigation Guide",
91 "Data Source: Elastic Endgame",
92 "Data Source: Elastic Defend",
93 "Data Source: Windows Security Event Logs",
94 "Data Source: Microsoft Defender XDR",
95 "Data Source: Sysmon",
96 "Data Source: SentinelOne",
97 "Data Source: Crowdstrike",
98 "Noise: Medium",
99 "Performance: Normal",
100 "Rule Type: Event Correlation (EQL)",
101 "Platform: Windows",
102]
103timestamp_override = "event.ingested"
104type = "eql"
105
106query = '''
107process where host.os.type == "windows" and event.type == "start" and
108 (process.name : "netsh.exe" or ?process.pe.original_file_name == "netsh.exe") and
109 process.args : ("localport=3389", "RemoteDesktop", "group=\"remote desktop\"") and
110 process.args : ("action=allow", "enable=Yes", "enable")
111'''
112
113
114[[rule.threat]]
115framework = "MITRE ATT&CK"
116
117[[rule.threat.technique]]
118id = "T1562"
119name = "Impair Defenses"
120reference = "https://attack.mitre.org/techniques/T1562/"
121
122[[rule.threat.technique.subtechnique]]
123id = "T1562.004"
124name = "Disable or Modify System Firewall"
125reference = "https://attack.mitre.org/techniques/T1562/004/"
126
127[rule.threat.tactic]
128id = "TA0005"
129name = "Defense Evasion"
130reference = "https://attack.mitre.org/tactics/TA0005/"
131
132[[rule.threat]]
133framework = "MITRE ATT&CK"
134
135[[rule.threat.technique]]
136id = "T1021"
137name = "Remote Services"
138reference = "https://attack.mitre.org/techniques/T1021/"
139
140[[rule.threat.technique.subtechnique]]
141id = "T1021.001"
142name = "Remote Desktop Protocol"
143reference = "https://attack.mitre.org/techniques/T1021/001/"
144
145[rule.threat.tactic]
146id = "TA0008"
147name = "Lateral Movement"
148reference = "https://attack.mitre.org/tactics/TA0008/"
Triage and analysis
Investigating Remote Desktop Enabled in Windows Firewall by Netsh
Microsoft Remote Desktop Protocol (RDP) is a proprietary Microsoft protocol that enables remote connections to other computers, typically over TCP port 3389.
Attackers can use RDP to conduct their actions interactively. Ransomware operators frequently use RDP to access victim servers, often using privileged accounts.
This rule detects the creation of a Windows Firewall inbound rule that would allow inbound RDP traffic 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.
- Check whether it makes sense to enable RDP to this host, given its role in the environment.
- Check if the host is directly exposed to the internet.
- Check whether privileged accounts accessed the host shortly after the modification.
- Review network events within a short timespan of this alert for incoming RDP connection attempts.
False positive analysis
- The
netsh.exeutility can be used legitimately. Check whether the user should be performing this kind of activity, whether the user is aware of it, whether RDP should be open, and whether the action exposes the environment to unnecessary risks.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- If RDP is needed, make sure to secure it:
- Allowlist RDP traffic to specific trusted hosts.
- Restrict RDP logins to authorized non-administrator accounts, where possible.
- 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