29-11-2016 / Vulnerabilities

WinPower V4.9.0.4 Privilege Escalation

UPSmonitor runs as SYSTEM process.

c:\sc query "UPSmonitor"
SERVICE_NAME: UPSmonitor
        TYPE               : 110  WIN32_OWN_PROCESS  (interactive)
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
c:\wmic service where name="UPSmonitor" get StartName
StartName
LocalSystem

We can communicate with monitor using RMI interface.

In manager app there's an "Administrator" password check, but the password isn't verified inside monitor process.

So we can modify any application settings without knowing administrator password.

What is more interesting we can set command which will be executed when monitor get "remote shutdown command".

Because monitor runs as SYSTEM process, this command is also executed with SYSTEM privileges.

So using this we can create new administrator account.

Proof of Concept

Below POC sets all necessary options (such as shutdown command path).

Then it sends remote shutdown command to localhost.

After successfull exploitation, new administrator account will be created.

Exploit Source Code

Compiled Exploit

To run the exploit, use the following command:

"C:\Program Files (x86)\MonitorSoftware\jre\bin\java.exe" -classpath ".;C:\Program Files (x86)\MonitorSoftware\otherlib\AdventNetSnmp.jar;C:\Program Files (x86)\MonitorSoftware\Application.jar;C:\Program Files (x86)\MonitorSoftware\otherlib\snmpmanager.jar;C:\Program Files (x86)\MonitorSoftware\otherlib\AdventNetLogging.jar;" WinPowerExploit

Timeline

  • 31-10-2016: Discovered, cannot find software author