Skip to content
Access control Write-up Advanced

PsExec Local Privilege Escalation

A local privilege escalation in PsExec allows a non-admin process to escalate to SYSTEM by creating the PSEXESVC named pipe before the service starts, causing the service to use the attacker's pipe with its own ACL. An attacker can then communicate with the SYSTEM service and execute arbitrary binaries as SYSTEM.

medium.com

Published on medium.com

So…this one’s been here for a while: a local privilege escalation vulnerability in PsExec. This local privilege escalation allows a non-admin process to escalate to SYSTEM if PsExec is executed locally or remotely on the target machine.

David Wells, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

A non-admin user could escalate to SYSTEM if PsExec is run on the machine, and the vulnerability affects PsExec versions from v1.72 to v2.2 and also v2.30 and v2.32.

What the attacker needed

Low-privilege access to the target machine; PsExec executed locally or remotely on the machine

How it was found

  1. Create a named pipe called \PSEXESVC with read/write access for a non-admin user.
  2. Wait for PsExec to be executed locally or remotely on the machine.
  3. The PSEXESVC service obtains a handle to the attacker's pipe instead of creating its own.
  4. Communicate over the pipe using the reverse-engineered PSEXESVC protocol to execute a binary as SYSTEM.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

PsExec is a tool that lets administrators run programs on other computers. It uses a named pipe (a way for programs to talk) to send commands. The bug is that a low-privilege user can create that pipe first, and then PsExec connects to it without checking, letting the user send commands as the powerful SYSTEM account.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.