Title: From Service Manager to SYSTEM: Abusing NSSM 2.24 for Privilege Escalation
Date: [Insert Date] Tags: #Windows #PrivilegeEscalation #NSSM #InfoSec
To secure systems running NSSM 2.24 against this vulnerability, administrators should implement the following measures:
nssm install ServiceName "C:\Program Files\My Service\service.exe"C:\, C:\Program Files) have strict ACLs. Standard users should not have "Write" or "Modify" permissions in these directories.HKLM\SYSTEM\CurrentControlSet\Services\ServiceName) to Administrators and SYSTEM only.sc sdshow to ensure standard users do not have permission to change service configuration (SERVICE_CHANGE_CONFIG).Modern service managers include safeguards against arbitrary binary replacement and insecure service configuration modification. NSSM 2.24, however, was designed for convenience—not security. Its core features that enable privilege escalation include: nssm-2.24 privilege escalation
HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>\Parameters, but older versions fail to enforce strict permissions.An attacker with low-privileged access (e.g., a standard user on a compromised workstation or via a reverse shell) first enumerates all services:
sc query state= all | findstr "SERVICE_NAME"
They then check for NSSM-managed services by looking for display names or descriptions containing "NSSM" or by inspecting the binary path:
sc qc <service_name>
If the BINARY_PATH_NAME points to an NSSM executable (e.g., C:\nssm-2.24\win32\nssm.exe), the service is a candidate. Title: From Service Manager to SYSTEM: Abusing NSSM 2
Look for:
HKLM\SYSTEM\CurrentControlSet\Services\*\Parameters\Application.services.exe (e.g., cmd.exe launching a reverse shell).type C:\ProgramData\poc.txt
On a vulnerable system, this file will be created by SYSTEM. On a patched system, NSSM will reject the change due to validation errors. Update Software: Update NSSM to the latest stable
The issue is not a memory corruption bug but a logic/permission flaw:
HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>\Parameters\Application.sc config if the service DACL is weak).SYSTEM.Blue teams can detect exploitation attempts via:
NSSM is a popular open-source utility that wraps any executable (e.g., a batch script, Python app, or Node.js server) into a Windows service. It’s widely used in development environments, CI/CD runners, and even production systems.