IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Remote Desktop Enabled in Windows Firewall by Netsh
editRemote Desktop Enabled in Windows Firewall by Netsh
editIdentifies use of the network shell utility (netsh.exe) to enable inbound Remote Desktop Protocol (RDP) connections in the Windows Firewall.
Rule type: eql
Rule indices:
- winlogbeat-*
- logs-endpoint.events.*
- logs-windows.*
Severity: medium
Risk score: 47
Runs every: 5 minutes
Searches indices from: now-9m (Date Math format, see also Additional look-back time
)
Maximum alerts per execution: 100
Tags:
- Elastic
- Host
- Windows
- Threat Detection
- Defense Evasion
Version: 6 (version history)
Added (Elastic Stack release): 7.11.0
Last modified (Elastic Stack release): 8.3.0
Rule authors: Elastic
Rule license: Elastic License v2
Investigation guide
edit## 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.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. ### 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). ## Config If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
Rule query
editprocess where event.type in ("start", "process_started") and (process.name : "netsh.exe" or process.pe.original_file_name == "netsh.exe") and process.args : ("localport=3389", "RemoteDesktop", "group=\"remote desktop\"") and process.args : ("action=allow", "enable=Yes", "enable")
Threat mapping
editFramework: MITRE ATT&CKTM
-
Tactic:
- Name: Defense Evasion
- ID: TA0005
- Reference URL: https://attack.mitre.org/tactics/TA0005/
-
Technique:
- Name: Impair Defenses
- ID: T1562
- Reference URL: https://attack.mitre.org/techniques/T1562/
Rule version history
edit- Version 6 (8.3.0 release)
-
- Formatting only
- Version 5 (8.2.0 release)
-
- Rule name changed from: Remote Desktop Enabled in Windows Firewall
- Version 4 (7.16.0 release)
-
- Formatting only
- Version 3 (7.12.0 release)
-
- Formatting only
- Version 2 (7.11.2 release)
-
- Formatting only