Skip to content
RCE Write-up Advanced

Turning Enterprise Update Servers Into Backdoor Factories (0_o) – Part 2

WSUS downloads update files via BITS and normally requires executables to be digitally signed, but the signature check is skipped for files ending in .txt or .esd. An attacker with database access could deploy a malicious update that installs an unsigned payload on clients, leading to code execution.

Beyviel David Follow

Published on specterops.io

In Part 1 of this series, I walked through the necessary stored procedures used to create a custom malicious update. This blog will continue where we left off and showcase some blockers that I ran into like trouble downloading our payload and file signature requirements.

Beyviel David, on specterops.io

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

The file verification function in WSUS's ContentSyncAgent skips the digital signature check when the filename ends with .txt or .esd.

Impact

An attacker with database access could deploy a malicious update that installs an unsigned payload on WSUS clients, leading to code execution and potential persistence.

What the attacker needed

Access to WSUS database; ability to execute stored procedures; BITS-compatible web server

The fix

The report does not state a specific fix, but recommends requiring Extended Protection for Authentication, restricting network access, and monitoring stored procedure executions.

How it was found

  1. Call the spDeployUpdate stored procedure to deploy a custom update.
  2. Observe that WSUS downloads files using BITS, requiring the server to support the Range header.
  3. Set up a BITS-compatible web server to serve the payload.
  4. Notice that WSUS rejects unsigned executables.
  5. Decompile Microsoft.UpdateServices.ContentSyncAgent.dll and find the VerifyFile function.
  6. Rename the payload to have a .txt or .esd extension to bypass signature verification.

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.

WSUS is a Microsoft tool that helps companies distribute software updates to Windows computers. This report shows that if an attacker can tamper with the WSUS database, they can create a fake update that installs malicious software on computers, because a security check can be bypassed by naming the file with a .txt or .esd extension.

What is RCE?

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

More by Beyviel David

View all

1 more disclosed report, best first.

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.