This detection identifies the presence of termsrv.dll, a component associated with Chinese-origin hacktools that may indicate reconnaissance or lateral movement activities within the environment. Proactively hunting for this artifact in Azure Sentinel is critical to uncover potential supply chain compromises or unauthorized remote access mechanisms before they escalate into higher-severity incidents.
rule Tools_termsrv {
meta:
description = "Chinese Hacktool Set - file termsrv.dll"
author = "Florian Roth"
reference = "http://tools.zjqhr.com/"
date = "2015-06-13"
hash = "294a693d252f8f4c85ad92ee8c618cebd94ef247"
strings:
$s1 = "Iv\\SmSsWinStationApiPort" fullword ascii
$s2 = " TSInternetUser " fullword wide
$s3 = "KvInterlockedCompareExchange" fullword ascii
$s4 = " WINS/DNS " fullword wide
$s5 = "winerror=%1" fullword wide
$s6 = "TermService " fullword wide
condition:
uint16(0) == 0x5a4d and filesize < 1150KB and all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 6 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the Chinese Hacktool Set - file termsrv.dll detection rule in an enterprise environment:
Microsoft Terminal Services Licensing Deployment
termsrv.dll within the %SystemRoot%\System32 directory to manage RDP session limits.ccmexec.exe (SCCM) or msiexec.exe, specifically targeting files located in C:\Windows\System32\termsrv.dll.Third-Party RDP Management Suite Installation
termsrv.dll to enhance their own Remote Desktop Protocol monitoring capabilities and session auditing features.termsrv.dll initiated by known management binaries such as SolarWinds.Agent.exe, IvantiAgent.exe, or AltirisAgent.exe.Scheduled Group Policy Object (GPO) Updates
gpupdate utility triggers a background process that validates and potentially re-registers system DLLs, including termsrv.dll, ensuring compliance with security baselines defined by tools like Microsoft Endpoint Configuration Manager.