Skip to content
RCE Write-up Intermediate

Openvas Credentials Hunt — Part II

The OpenVAS Windows credential deployment package read a group name from a globally writable temp file and inserted it unsanitised into a command line. An attacker with local access could plant a tampered file so that their own command ran with administrative privileges when the package was executed.

medium.com

Published on medium.com

In my last post, I described how it is (was?) possible to use the OpenVAS Download an EXE package for Microsoft Windows feature to extract username and passwords stored as credentials in the open-source vulnerability scanner. What I did not tell last time is that this same feature also can be used as a privilege…

Daniel Santos, 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

The deployment package trusted a file in a world-writable directory and concatenated its contents into a shell command without validation.

Impact

An attacker with local access to a machine where the package runs regularly could execute arbitrary commands with administrative privileges.

What the attacker needed

Local access to the target Windows host; deployment package runs there, often as admin

The fix

The issue was fixed by the OpenVAS team.

How it was found

  1. Obtain the OpenVAS credential deployment executable.
  2. Create an AdminGroupName.txt file in the Windows temp directory containing a command injection payload.
  3. Make the file read-only so the package cannot overwrite it.
  4. Run the credential deployment package and observe the payload executing.

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.

OpenVAS is a vulnerability scanner that can push a small program to Windows machines to create scanning accounts. That program looked up the name of the local administrators group by reading a text file in a shared temporary folder that any user on the machine can write to. Because the contents were pasted straight into a system command, a normal user could put extra commands in the file and have them run as an administrator.

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.