🆕 Introducing HTB CDEP: Certified Detection Engineering Principal Learn More

RDP Lateral Movement Detection

mini-module tag Mini-Module

In today's digital landscape, detecting lateral movement is crucial for maintaining a secure network environment. This module offers in-depth insights into identifying and responding to RDP (Remote Desktop Protocol) lateral movement—a common technique employed by cyber attackers to navigate through compromised systems. Through a blend of theoretical knowledge and practical exercises, participants will gain a thorough understanding of the tactics, techniques, and procedures (TTPs) used in lateral movement attacks. Additionally, the module will provide hands-on tutorials for implementing effective detection and response strategies, enabling learners to safeguard their organization's networks more efficiently.

Created by letsdefendio

Hard Defensive

Summary

The RDP Lateral Movement Detection module is designed for

  • Cybersecurity professionals seeking to strengthen their incident detection capabilities and
  • Network security analysts focusing on threat detection and response. Throughout this module, students will develop
  • Develop skills to detect and analyze RDP lateral movement in network environments, - Understand the tactics used in lateral movement attacks, and
  • Gain practical experience through guided tutorials and real-world scenarios.

Recommended prior knowledge:

  • Basic understanding of networking concepts

  • Familiarity with cybersecurity principles

  • Knowledge of remote desktop protocol (RDP)

Introduction


Remote Desktop Protocol (RDP), originally developed by Microsoft for remote system administration, has become one of the most abused protocols for lateral movement during network intrusions. While RDP provides legitimate graphical remote control of Windows systems, attackers exploit it to expand their access within compromised environments.

Lateral movement refers to techniques attackers use to move a network horizontally after gaining initial access. Unlike vertical movement (penetrating deeper into a single system), lateral movement targets systems at the same trust level to:

  • Access valuable data

  • Establish persistence

  • Evade detection

RDP is prevalent in corporate environments due to its convenience for remote work. It is used to fix system issues and install updates. However, this also makes it a prime target for attackers because:

  • It provides full GUI control of remote systems.

  • Attackers can operate undetected without physical access.

  • Legitimate usage masks malicious activity.


How RDP Works

To understand how attackers exploit RDP for lateral movement, we must first examine the protocol's technical operation. An RDP connection establishes a remote graphical session through these sequential steps:

  • Connection Initiation:The client machine connects to the target server via TCP port 3389 (RDP's default port).

  • Security Negotiation:The server and client establish encryption protocols and exchange digital certificates to create a secure channel.

  • Authentication:The client provides valid credentials (username/password) for server verification.

  • Session Establishment:After authentication, the server transmits graphical interface data to the client while receiving keyboard and mouse inputs in return.

This process creates a fully interactive session that provides complete GUI control of the remote system - functionality that benefits both administrators and attackers alike.


Why RDP is the Most Abused Remote Access Protocol

Remote Desktop Protocol (RDP) is a common target for attackers because it serves a legitimate and essential role. Employees and system administrators use it regularly for remote access. The key to identifying potential threats lies in establishing a baseline of normal RDP usage.

Consider this example: if employees use RDP to connect to their workstations remotely, their activity typically follows a regular pattern, such as standard business hours from 9 AM to 5 PM. While connections outside this timeframe might not be immediately suspicious, they should still be reviewed. An employee may simply be working late or meeting a critical deadline.

However, if RDP activity occurs at 3 AM on a weekend or public holiday, the context becomes much more suspicious. Attackers often take advantage of non-working hours to avoid detection and reduce the chances of raising alerts.

In addition to unusual timing, other anomalies can signal malicious activity. For example, if a computer in the human resources department attempts to authenticate to a system in the finance department using RDP, that would be highly irregular and should prompt further investigation.

By monitoring these behavioral patterns, organizations can more effectively detect and respond to malicious RDP activity.


Common RDP Lateral Movement Techniques

Credential Theft and Reuse

The most common approach to RDP lateral movement involves stealing credentials and using them to authenticate to other systems. Attackers employ multiple methods to harvest credentials:

  • LSASS Memory Extraction: Tools like Mimikatz recover plaintext passwords from system memory.

  • Keystroke Logging:Capturing credentials during legitimate authentication.

  • Credential Cache Attacks: Exploiting Windows' credential storage mechanisms.

A common tactic is Pass-the-Hash (PtH), where attackers use captured NTLM hashes to authenticate to systems without needing to crack the password.

Once credentials are obtained, attackers use standard RDP clients to connect to other systems where the credentials are valid.

RDP Session Hijacking

Instead of establishing new connections, attackers may hijack existing RDP sessions. This technique involves the following steps:

  • Identifying active RDP sessions on a compromised system

  • Elevating privileges to the SYSTEM level

  • Taking control of the session token

  • Redirecting the session to the attacker's client

This method is particularly stealthy because it does not generate new logon events and can bypass certain monitoring controls. It is difficult to detect and falls outside the scope of this module.

Exploiting RDP Vulnerabilities

The RDP protocol has vulnerabilities that have enabled lateral movement without requiring valid credentials. The most infamous example is BlueKeep (CVE-2019-0708), a remote code execution vulnerability that affects older Windows systems. Similarly, vulnerabilities like DejaBlue allow attackers to move between systems by exploiting RDP security flaws.


Real-World Attack Scenario

To understand how attackers use RDP for lateral movement, consider the following scenario:

  • An attacker gains initial access to a workstation through a phishing email.

  • Using privilege escalation techniques, the attacker obtains administrative access to the workstation.

  • The attacker runs Mimikatz to extract credentials from memory, retrieving the password hash of a domain administrator who previously logged into the system.

  • With these credentials, the attacker establishes RDP connections to other systems within the network.

  • Each compromised system yields new credentials, allowing access to additional systems.

  • Eventually, the attacker reaches the domain controllers and gains persistent control over the entire network.

This example illustrates how a single compromised endpoint can lead to a full-scale network compromise through RDP-based lateral movement.

In this module, we will explore various Windows artifacts and data sources that help identify patterns of RDP lateral movement within an environment. We will take an in-depth look at digital forensics techniques and examine key artifacts such as Event Logs, the Windows Registry, Bitmap Cache, and process execution evidence including Prefetch files and Amcache data.

The next section will cover Detecting RDP Activity via Event Logs.

Sign Up / Log In to Unlock the Module

Please Sign Up or Log In to unlock the module and access the rest of the sections.