Tampering of RDP Terminal Services Registry Settings
Adversaries, including the DarkGate malware operators, modify sensitive registry keys associated with Terminal Services to facilitate session hijacking, unauthorized remote access, and defense impairment.
Adversaries frequently target the Windows registry keys associated with Terminal Services and Remote Desktop Protocol (RDP) to gain persistent access, intercept user sessions, or impair security controls. By modifying specific configuration values under HKLM\SOFTWARE\Microsoft\Windows NT\Terminal Services or HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server, attackers can enable unauthorized shadowing, disable security layer requirements, or execute arbitrary programs upon user login. Notable threats, such as the DarkGate malware, have been observed modifying 'DisableRemoteDesktopAntiAlias' and 'DisableSecuritySettings' to facilitate their operations. Defenders must monitor these registry paths, as unauthorized modifications often indicate an attempt to bypass existing RDP security configurations or establish persistent, stealthy access to the target host.
Attack Chain
- Attacker gains elevated administrative privileges on the target Windows system.
- Attacker locates the sensitive registry keys under HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server or HKLM\SOFTWARE\Microsoft\Windows NT\Terminal Services.
- Attacker modifies the 'ServiceDll' value to perform RDP hijacking by specifying a malicious custom DLL.
- Attacker adjusts 'DisableSecuritySettings' or 'DisableRemoteDesktopAntiAlias' to weaken RDP connection requirements.
- Attacker enables RDP 'Shadow' keys to view or control active user sessions without authorization.
- Attacker configures the 'InitialProgram' key to execute a malicious payload automatically upon the next remote session login.
- Attacker initiates an RDP connection to the compromised host using the newly established persistent or stealthy access configuration.
Impact
Successful manipulation of RDP registry settings enables adversaries to maintain persistence, conduct credential harvesting via session monitoring, move laterally within an environment, and disable security layers that protect remote access, potentially leading to full system compromise and data exfiltration.
Recommendation
- Deploy the Sigma rule below to detect unauthorized modifications to sensitive Terminal Services registry keys.
- Enable Sysmon registry-set logging (Event ID 13) to capture changes to the defined registry paths.
- Investigate any alerts originating from legitimate administrative activity to distinguish between authorized group policy updates and potential malicious tampering.
- Establish a baseline for RDP configuration and alert on deviations, particularly for keys related to 'Shadow' and 'ServiceDll'.
Immediate actions
Deploy the Sigma detection rule to the SIEM.
Threat Hunt
Search for existing registry modifications within the Terminal Services paths.
Data: Registry modification logs (Sysmon Event 13)
Mitigations
Enforce strict Group Policy controls over RDP configuration to prevent unauthorized registry modification.
T1112
Detection coverage 1
Detect Tampering of RDP Terminal Server Registry Keys
highDetects modifications to sensitive RDP and Terminal Services registry keys used for session shadowing, hijacking, or weakening security settings.
Detection queries are available on the platform. Get full rules →