Chaining IDOR and Command Injection to Fully Own HwatNetOps
The application exposed account details, including plaintext passwords, through an IDOR on a numeric account ID parameter, allowing enumeration of other users' credentials. After logging in as an admin with stolen credentials, a network diagnostics tool passed user input to a system command without sanitisation, enabling command injection and remote code execution.
medium.com
Published on medium.com
Another box, another win. HwatNetOps is a deliberately vulnerable internal network operations portal and today I’m going to walk through how I chained two vulnerabilities together to go from zero access to reading the flag off the server.
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 account page looked up records by the supplied ID without verifying the logged-in user owned that record, and the diagnostics tool concatenated user input into a shell command without sanitisation.
Impact
An attacker could read any user's plaintext password, take over the admin account, and then run arbitrary commands on the server, leading to full compromise of the box.
What the attacker needed
A free account; admin panel access after credential theft
The fix
The account page should check that the requested record belongs to the logged-in user and should never store or display plaintext passwords, while the diagnostics tool should avoid shell invocation and strictly validate the hostname and port.
How it was found
- Create a throwaway account and log in to reach the profile page.
- Observe the numeric id parameter in the profile URL and change it to enumerate other accounts.
- Find the admin account's plaintext credentials at a nearby ID and log in as admin.
- Open the Admin Panel's Network Diagnostics tool and run a normal ping to see the output format.
- Inject a shell command after the hostname to confirm remote code execution.
- Read /etc/passwd, list the discovered user's home directory, and read the flag file.
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.
An IDOR (Insecure Direct Object Reference) happens when a website uses a simple identifier like a number in the URL to decide which record to show, but never checks whether you are allowed to see that record. Here, changing the number showed other people's account details, including their passwords. Later, an admin-only tool that ran a ping command accepted extra input and ran it as a system command, which let the attacker run their own commands on the server.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.