Detection of CMSTP App Paths Registry Modification
Adversaries leverage the Microsoft Connection Manager Profile Installer (CMSTP) via registry modifications to achieve arbitrary code execution or bypass User Account Control (UAC).
Microsoft Connection Manager Profile Installer (CMSTP.exe) is a legitimate Windows binary designed to install Connection Manager service profiles. Threat actors frequently abuse this utility to execute arbitrary code or bypass UAC. The technique involves manipulating specific registry keys within the App Paths hive, which influences how the operating system handles execution requests or loads associated dynamic link libraries (DLLs). By modifying these registry paths, attackers can force CMSTP to load malicious DLLs or configuration files, facilitating execution in a higher-privileged context. This is a well-documented LOLBAS (Living Off the Land Binary and Script) technique that persists across modern Windows environments, requiring defenders to monitor registry modifications associated with CMSTP's configuration parameters.
Attack Chain
- Attacker identifies a target system where CMSTP.exe execution is permissible.
- Attacker prepares a malicious DLL or configuration profile (INF file) to be loaded by CMSTP.
- Attacker gains sufficient privileges to modify the Windows registry.
- Attacker performs a write operation to the registry key HKLM or HKCU under Software\Microsoft\Windows\CurrentVersion\App Paths\cmmgr32.exe.
- Attacker executes cmstp.exe via command line or automated script.
- CMSTP.exe references the modified App Paths registry key.
- CMSTP.exe loads the attacker-supplied DLL or INF file, bypassing security controls or executing arbitrary logic.
- Final objective is achieved, such as privilege escalation, persistence, or payload execution.
Impact
Successful abuse of this technique allows an attacker to execute code with elevated privileges, bypassing standard UAC protections. This facilitates further post-exploitation activities, including credential dumping, lateral movement, or the deployment of ransomware within an organization.
Recommendation
- Deploy the provided Sigma rule to monitor registry modifications targeting cmmgr32.exe App Paths.
- Alert on any write operations to the registry path SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cmmgr32.exe\ that are not associated with authorized system updates.
- Utilize Sysmon or native Windows Registry auditing to capture the process ID responsible for the registry change, ensuring attribution back to the parent process.
Immediate actions
Deploy the Sigma rule to monitor registry modifications in the App Paths hive for cmmgr32.exe
Threat Hunt
Search historical registry modification logs for write operations to HKLM or HKCU under \App Paths\cmmgr32.exe\
Data: Registry Set (Event ID 12/13)
Detection coverage 1
CMSTP App Paths Registry Key Modification
highDetects modifications to the CMSTP App Paths registry key indicating potential abuse for arbitrary code execution or UAC bypass.
Detection queries are available on the platform. Get full rules →