Skip to content
RCE Write-up Advanced

Exploiting LPE on Windows Server via LocalPotato (CVE-2023–2174

The Windows Storage Service (StorSvc) RPC method SvcRebootToFlashingMode did not properly check caller privileges and loaded a DLL (SprintCSP.dll) from a PATH directory without validation, allowing a low-privileged local user to place a malicious DLL and have it executed as SYSTEM. The authors chained this with LocalPotato to write the DLL into System32 and then triggered the RPC call to obtain a SYSTEM reverse shell.

Farhad Anwari Follow

Published on medium.com

This is a condensed report and write-up of our project report that was part of the first-year master’s program at the University of Southern Brittany and our program CYBERUS Erasmus Mundus Joint Master's in Cybersecurity.

Farhad Anwari, 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

Root cause

Likely the StorSvc RPC method lacked a caller privilege check and loaded SprintCSP.dll from PATH directories without validating the DLL, enabling DLL hijacking.

Impact

A local low-privileged user could escalate to SYSTEM, enabling arbitrary code execution, file modification, backdoor installation, and further network compromise; the text notes the flaw does not directly lead to arbitrary code execution but is a privilege escalation vector.

What the attacker needed

Local low-privileged account; unpatched Windows Server 2019; ability to write to a PATH directory

The fix

Microsoft fixed the vulnerability in the January 2023 Patch Tuesday updates by correcting privilege checks in StorSvc and improving how DLL files are loaded.

How it was found

  1. Set up an unpatched Windows Server 2019 virtual machine and install MSBuild.
  2. Modify the RPC client source to target Windows Server 2019 and compile RpcClient.exe with msbuild.
  3. Generate a Meterpreter reverse shell payload and start a Metasploit listener.
  4. Modify the SprintCSP DLL source so its DoStuff function runs a Base64-encoded PowerShell command that downloads and executes the payload, then compile the DLL.
  5. Use LocalPotato to copy the malicious SprintCSP.dll into C:\Windows\System32.
  6. Run RpcClient.exe as the low-privileged user to trigger SvcRebootToFlashingMode, receive the reverse shell, and confirm SYSTEM via getuid.

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.

On Windows, some background services run with the highest level of permission (SYSTEM). This service asked for a helper file by name and would accept it from any folder listed in the system's search path, without checking who put it there. A normal user could therefore drop a file with that name into a writable folder, trigger the service, and have their own code run with SYSTEM rights.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.