Escalation: Nssm-2.24 Privilege
Detailed Review: NSSM-2.24 Privilege Escalation Vulnerability
Improper File Permissions: Many applications bundle nssm.exe but fail to secure its directory. For example, if a "Users" group has full control (the 'F' flag) over the binary or its parent folder, an attacker can replace nssm.exe with a malicious rootkit. When the service restarts, it executes the replacement with elevated privileges. nssm-2.24 privilege escalation
Least Privilege: Configure the service to "Log on" as a specific user with the minimum required permissions rather than the default SYSTEM account. Download - NSSM - the Non-Sucking Service Manager Detailed Review: NSSM-2
Event Logs
- Event ID 7045 (A service was installed on the system) – Look for sudden
binPathchanges toC:\Users\Public,C:\Temp, orAppDatafolders. - Event ID 7036 (Service control manager) – Unexpected stop/start of known NSSM services.
- Event ID 4698 (Scheduled task created) – Attackers often layer persistence.
3. Proof of Concept (Conceptual)
- Discovery: An attacker enumerates services installed via NSSM using standard Windows commands (e.g.,
sc qc ServiceNameorwmic service). - Vulnerability Identification: The attacker identifies that the service binary path contains spaces and is not enclosed in quotes (Unquoted Service Path), or that the NSSM parameters allow for command injection.