Skip to content
RCE Write-up Beginner

πŸ’° $9,060 OS Command Injection β€” Private Bug Bounty P1 | 2023

A parameter on a network device's web interface passed user input to the operating system without sanitisation, allowing command injection. An attacker could run arbitrary commands as root and fully compromise the device.

Krish_cyber Follow

Published on krishna-cyber.medium.com

Every bug bounty hunter dreams of that one big find β€” the kind that lands you in the P1 category with a massive payout. Well, this was one of those moments!

Krish_cyber, on krishna-cyber.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 application concatenated user-supplied input into a shell command without sanitising or escaping it, and ran with root privileges.

Impact

An attacker could gain full control of the device, steal sensitive configuration data and use it to launch further attacks on the network.

What the attacker needed

Access to the device's web interface; a parameter that accepts user input

The fix

The application should avoid passing user input to a shell, or strictly validate and escape it, and should not run with root privileges.

How it was found

  1. Identify a parameter that accepts user input and is passed to the system.
  2. Send a basic command-injection payload and observe a directory listing.
  3. Escalate with further commands to read system information and sensitive files.
  4. Check the privilege level of the executing process and confirm root access.

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 device's web page took text from a form and handed it straight to the underlying operating system. By adding a semicolon and a system command, the tester made the device run that command too. Because the web service ran as the all-powerful root user, the attacker could read files and take over the whole device.

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 Krish_cyber

View all

12 more disclosed reports, 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.