Terminal Services DLL

T1505.005

Sub-technique of T1505 Server Software Component.View on attack.mitre.org

About this technique

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.

Windows Services that are run as a "generic" process (ex: svchost.exe) load the service's DLL file, the location of which is stored in a Registry entry named ServiceDll. The termsrv.dll file, typically stored in `%SystemRoot%\System32\`, is the default ServiceDll 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. Modifications to this DLL could be done to execute arbitrary payloads (while also potentially preserving normal termsrv.dll 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 termsrv.dll file or modifying the ServiceDll value to point to a DLL that provides increased RDP functionality. 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.

Detection rules1

Rules on DetectionCode tagged with T1505.005.

Sigma1

RuleLevelLog source
Potential Suspicious Activity Using SeCEditmediumwindows / process_creation

Splunk0

No Splunk rules are mapped to this technique yet.

Groups0

None recorded.

Software0

None recorded.

Campaigns0

None recorded.

Procedure examples0

No procedure examples are recorded for this technique.

References5

  1. James TermServ DLL Open source
    James. (2019, July 14). @James_inthe_box. Retrieved September 12, 2024.
  2. Microsoft Remote Desktop Services Open source
    Microsoft. (2019, August 23). About Remote Desktop Services. Retrieved March 28, 2022.
  3. Microsoft System Services Fundamentals Open source
    Microsoft. (2018, February 17). Windows System Services Fundamentals. Retrieved March 28, 2022.
  4. RDPWrap Github Open source
    Stas'M Corp. (2014, October 22). RDP Wrapper Library by Stas'M. Retrieved March 28, 2022.
  5. Windows OS Hub RDP Open source
    Windows OS Hub. (2021, November 10). How to Allow Multiple RDP Sessions in Windows 10 and 11?. Retrieved March 28, 2022.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.