Nssm-2.24 Privilege Escalation -
net stop <service_name> net start <service_name> The service runs as (by default for manually installed services), executing malware.exe with the highest privileges. Step 5 – Persistence & Lateral Movement The malware can now add a new admin user, dump credentials from LSASS, or implant a backdoor—all while masquerading as a legitimate service. Real-World Attack Scenario Imagine a corporate environment using a legacy monitoring agent installed via NSSM 2.24 on hundreds of Windows Server 2012 R2 machines. A contractor with limited access discovers the NSSM service LegacyMonitor has its binary stored in C:\ProgramData\Monitor\ . The ProgramData folder, by default, grants BUILTIN\Users write access.
If you must use NSSM, migrate to version 2.24 . Better yet, use a maintained alternative like WinSW with XML configuration files that support integrity checks. Conclusion NSSM 2.24 privilege escalation is not a classic buffer overflow or race condition—it is a design weakness amplified by common misconfigurations. Attackers love it because it turns a low-privilege foothold into full SYSTEM access with minimal noise.
The key takeaway: . Run accesschk.exe -c * | findstr "NSSM" across your Windows fleet. If you find NSSM 2.24, assume it is a potential backdoor. Harden it, replace it, or risk becoming the next case study in a privilege escalation report. Appendix: Quick Fix Commands # Find NSSM services Get-WmiObject win32_service | Where-Object $_.PathName -like "*nssm*" | Format-Table Name, StartName, PathName Restrict service modification to Administrators sc sdset MyNSSMService "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)" Change binary path to secure location sc config MyNSSMService binPath= "C:\Program Files\SecureApp\app.exe" obj="NT AUTHORITY\LocalService" nssm-2.24 privilege escalation
Introduction NSSM (Non-Sucking Service Manager) has long been a staple for system administrators and developers on the Windows platform. Versions like 2.24 , released in the mid-2010s, are celebrated for their ability to turn any executable into a Windows service quickly. However, beneath its utilitarian veneer lies a dangerous attack vector: privilege escalation .
Stay secure. Never trust legacy wrappers with SYSTEM privileges. A contractor with limited access discovers the NSSM
nssm set <service_name> Application "C:\temp\malware.exe" The attacker stops and restarts the service (if they have SERVICE_START and SERVICE_STOP rights) or waits for a system reboot:
But the real prize is . On many systems, authenticated users can enumerate and modify NSSM-managed services due to overly permissive service security descriptors. Technical Deep Dive: How the Escalation Works Step 1 – Enumeration An attacker with low-privileged access (e.g., a standard user on a compromised workstation or via a reverse shell) first enumerates all services: Better yet, use a maintained alternative like WinSW
accesschk.exe -uwcqv "Authenticated Users" <service_name> accesschk.exe -uwcqv "BUILTIN\Users" <service_name> If the attacker has write access to the service configuration (often misconfigured in legacy systems), they can proceed. The attacker changes the binPath to point to a malicious executable they control: