Detect Remote Desktop Protocol in Splunk
Adversaries may use Valid Accounts to log into a computer using the Remote Desktop Protocol (RDP). RDP is a common feature in Windows that allows interactive graphical sessions on remote systems. Threat actors including Kimsuky, INC Ransom, Volt Typhoon, Wizard Spider, BlackByte, Akira, and FIN7 have all leveraged RDP for lateral movement. Adversaries typically acquire credentials via Credential Access techniques, then use RDP to expand access to additional systems, deploy ransomware interactively, or establish persistence via Accessibility Features.
MITRE ATT&CK
- Tactic
- Lateral Movement
- Technique
- T1021 Remote Services
- Sub-technique
- T1021.001 Remote Desktop Protocol
- Canonical reference
- https://attack.mitre.org/techniques/T1021/001/
SPL Detection Query
index=wineventlog sourcetype="WinEventLog:Security" (EventCode=4624 OR EventCode=4625) Logon_Type=10
| eval SourceIP=coalesce('Source_Network_Address', IpAddress)
| where SourceIP!="127.0.0.1" AND SourceIP!="::1" AND SourceIP!="-" AND SourceIP!=""
| eval EventType=if(EventCode==4624, "RDP_Success", "RDP_Failure")
| eval Account=coalesce('Target_Account_Name', TargetUserName)
| eval TargetHost=coalesce(ComputerName, host)
| eval SensitiveHost=if(match(lower(TargetHost), "(dc|domain.controller|pdc|exchange|sql)"), 1, 0)
| eval PrivAccount=if(match(lower(Account), "(admin|administrator|svc_|service)"), 1, 0)
| stats count as EventCount,
values(EventType) as EventTypes,
values(Account) as Accounts,
dc(Account) as UniqueAccounts,
values(TargetHost) as TargetHosts,
max(SensitiveHost) as HitSensitiveHost,
max(PrivAccount) as PrivAccountUsed
by SourceIP, _time span=5m
| where EventCount >= 3 OR HitSensitiveHost=1 OR PrivAccountUsed=1
| eval RiskScore=EventCount + (HitSensitiveHost * 10) + (PrivAccountUsed * 5) + (UniqueAccounts * 2)
| sort - RiskScore Detects suspicious RDP activity (LogonType=10) from Windows Security event logs. Aggregates success and failure events by source IP over 5-minute windows, calculates a risk score based on volume, sensitive host targeting, and privileged account usage. High risk scores indicate brute-force or credential-stuffing attempts.
Data Sources
Required Sourcetypes
False Positives & Tuning
- IT administrators performing legitimate remote administration of servers and workstations via RDP
- Help desk staff using RDP to support end users from a central jump server
- Automated monitoring or patch management tools that connect via RDP
- VPN-connected remote workers whose IPs appear external
- Vendor remote support sessions with approved change tickets
Other platforms for T1021.001
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1RDP Connection to Remote Host
Expected signal: Sysmon Event ID 1: Process Create with Image=mstsc.exe, CommandLine='/v:127.0.0.1 /admin'. Sysmon Event ID 3: Network Connection to port 3389. Security Event ID 4624 (LogonType=10) on the target if RDP is enabled. Event ID 1149 in TerminalServices-RemoteConnectionManager log.
- Test 2Enable RDP and Create RDP-Accessible User
Expected signal: Sysmon Event ID 13 (Registry Value Set) for HKLM\System\CurrentControlSet\Control\Terminal Server\fDenyTSConnections. Sysmon Event ID 1 (Process Create) for net.exe with 'Remote Desktop Users' in command line. Security Event ID 4732 (member added to security-enabled local group). Security Event ID 4657 (registry value modified).
- Test 3Simulate RDP Brute Force (Authentication Failures)
Expected signal: Security Event ID 4625 (Logon Failure, LogonType=10) for each failed attempt. Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational Event ID 261. After 6 failures, detection threshold should fire.
- Test 4RDP Tunnel via NetSH Port Proxy
Expected signal: Sysmon Event ID 1: Process Create for netsh.exe with 'portproxy' and 'add' in command line. Registry change at HKLM\SYSTEM\CurrentControlSet\Services\PortProxy. Security Event ID 4688 for netsh.exe. Sysmon Event ID 12/13 for registry modification.
References (8)
- https://attack.mitre.org/techniques/T1021/001/
- https://technet.microsoft.com/en-us/windowsserver/ee236407.aspx
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-securityevent-table
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4624
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1021.001/T1021.001.md
- https://www.crowdstrike.com/blog/adversary-tricks-crowdstrike-treats/
- https://www.mandiant.com/resources/blog/fin12-ransomware-intrusion-actor-partnering-trickbot
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-038a
Unlock Pro Content
Get the full detection package for T1021.001 including response playbook, investigation guide, and atomic red team tests.