Skip to content
RCE Write-up Beginner

I PWNED A STOCK CHECKER USING ;whoami IN A POST REQUEST

The stock checker form passed the storeId parameter directly into a shell command without sanitisation. An attacker could append a shell command to that parameter and have it executed on the server, as shown by reading the operating system username.

RootPwned Follow

Published on medium.com

I used a sneaky ;whoami in a POST request to pop a shell command 💣 and dump the backend server user like a boss 😤 This wasn't just a URL hack — we got down & dirty with Burp Suite Repeater. Let's break it down ⬇️

Sumanth Yerranagula, 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 application passed user-controlled input directly into a shell command without sanitisation or validation.

Impact

An attacker could run arbitrary operating system commands on the server, potentially leading to reverse shells or data exfiltration.

What the attacker needed

Access to the stock checker form; ability to intercept and modify requests

The fix

The application should avoid passing user input into shell commands, for example by using safe APIs or strict allow-listing.

How it was found

  1. Intercept the stock checker request and note it is a POST to the stock endpoint with productId and storeId in the body.
  2. Modify the storeId value in Burp Repeater by appending a semicolon and a shell command.
  3. Send the request and read the command output in the response.

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.

The web app takes a value from a form and hands it to the computer's command line without checking it. By adding a semicolon and another command, the attacker makes the server run that extra command too. This is called command injection.

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.