Detection of RDP Configuration Tampering via Reg.exe
Adversaries frequently target Windows Registry keys related to Terminal Services to enable remote access, bypass session restrictions, or weaken security layers during lateral movement and persistence.
Adversaries often use the built-in Windows utility 'reg.exe' to manipulate Remote Desktop Protocol (RDP) settings as part of post-exploitation activity. By modifying specific registry keys under 'HKLM\System\CurrentControlSet\Control\Terminal Server', threat actors can enable unauthorized remote access, disable security layers to lower defense barriers, or configure concurrent session settings to facilitate persistent remote presence. This technique has been observed across various ransomware and malware campaigns, including Qakbot, Phobos, and Gentlemen ransomware. Monitoring for these modifications is critical for detecting lateral movement and unauthorized persistence establishment within an enterprise environment.
Attack Chain
- Attacker gains initial access or escalation of privilege on a Windows endpoint.
- Attacker identifies target RDP configuration parameters within the registry.
- Attacker executes 'reg.exe' via command line or automated script.
- Attacker uses 'reg.exe add' to modify specific values under 'CurrentControlSet\Control\Terminal Server'.
- Attacker specifies '/f' to force the registry overwrite without manual confirmation.
- Configuration changes take effect, enabling RDP or weakening authentication/encryption security layers.
- Attacker utilizes the altered configuration to initiate a remote session or maintain persistent access.
Impact
Successful tampering allows unauthorized remote access, bypasses intended security controls like Network Level Authentication (NLA) or TLS requirements, and assists in lateral movement. This can lead to total system compromise, exfiltration of sensitive data, and widespread ransomware deployment across the internal network.
Recommendation
Prioritize the implementation of process-creation logging to identify suspicious use of the 'reg.exe' utility.
- Deploy the provided Sigma rule to monitor for unauthorized modifications to Terminal Server registry keys.
- Establish an audit policy to alert on any modification of keys under 'HKLM\System\CurrentControlSet\Control\Terminal Server' by non-administrative service accounts or unauthorized processes.
- Review and baseline legitimate RDP configurations to differentiate between standard IT management tasks and malicious tampering attempts.
Immediate actions
Deploy the provided Sigma rule for reg.exe activity.
Threat Hunt
Search for reg.exe activity modifying Terminal Server registry keys.
Data: Process creation events
Mitigations
Restrict registry edit permissions for non-administrative service accounts.
T1112
Detection coverage 1
Potential Tampering With RDP Related Registry Keys Via Reg.EXE
highDetects the execution of reg.exe for enabling or disabling the RDP service on the host by tampering with 'CurrentControlSet\Control\Terminal Server' registry values.
Detection queries are available on the platform. Get full rules →