Adversaries may abuse components of Terminal Services to enable persistent access to systems. Microsoft Terminal Services, renamed to Remote Desktop Services in some Windows Server OSs as of 2022, enable remote terminal connections to hosts. Terminal Services allows servers to transmit a full, interactive, graphical user interface to clients via RDP.(Citation: Microsoft Remote Desktop Services)
Windows Services that are run as a "generic" process (ex: <code>svchost.exe</code>) load the service's DLL file, the location of which is stored in a Registry entry named <code>ServiceDll</code>.(Citation: Microsoft System Services Fundamentals) The <code>termsrv.dll</code> file, typically stored in %SystemRoot%\System32\
, is the default <code>ServiceDll</code> value for Terminal Services in HKLM\System\CurrentControlSet\services\TermService\Parameters\
.
Adversaries may modify and/or replace the Terminal Services DLL to enable persistent access to victimized hosts.(Citation: James TermServ DLL) Modifications to this DLL could be done to execute arbitrary payloads (while also potentially preserving normal <code>termsrv.dll</code> functionality) as well as to simply enable abusable features of Terminal Services. For example, an adversary may enable features such as concurrent Remote Desktop Protocol sessions by either patching the <code>termsrv.dll</code> file or modifying the <code>ServiceDll</code> value to point to a DLL that provides increased RDP functionality.(Citation: Windows OS Hub RDP)(Citation: RDPWrap Github) On a non-server Windows OS this increased functionality may also enable an adversary to avoid Terminal Services prompts that warn/log out users of a system when a new RDP session is created.
View in MITRE ATT&CK®Capability ID | Capability Description | Mapping Type | ATT&CK ID | ATT&CK Name |
---|---|---|---|---|
AC-12 | Session Termination | Protects | T1505.005 | Terminal Services DLL |
AC-17 | Remote Access | Protects | T1505.005 | Terminal Services DLL |
AC-2 | Account Management | Protects | T1505.005 | Terminal Services DLL |
AC-20 | Use of External Systems | Protects | T1505.005 | Terminal Services DLL |
AC-3 | Access Enforcement | Protects | T1505.005 | Terminal Services DLL |
AC-5 | Separation Of Duties | Protects | T1505.005 | Terminal Services DLL |
AC-6 | Least Privilege | Protects | T1505.005 | Terminal Services DLL |
CM-2 | Baseline Configuration | Protects | T1505.005 | Terminal Services DLL |
CM-6 | Configuration Settings | Protects | T1505.005 | Terminal Services DLL |
RA-5 | Vulnerability Scanning | Protects | T1505.005 | Terminal Services DLL |
SI-4 | Information System Monitoring | Protects | T1505.005 | Terminal Services DLL |