How I hacked multiple Indian universities (AGAIN).
The admin panel was protected only by client-side JavaScript redirection, so disabling JavaScript revealed privileged content. A stored XSS payload in an application form executed in the admin panel, and an old backup PHP file still contained the previously patched file upload vulnerability, allowing the attacker to regain a web shell and access email and CPanel credentials.
Published on medium.com
If you haven’t already read part 1 make sure to check that out here: https://medium.com/thedeephub/how-i-got-rce-on-an-indian-university-without-admin-credentials-tale-of-directory-listing-sql-1f77e2933011
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 admin panel relied on client-side JavaScript for access control, the application form did not sanitise user input before storing it, and an old backup PHP file retained the vulnerable upload code.
Impact
An attacker could gain full control of the server, read and modify emails, and take over CPanel accounts, potentially leading to root access.
What the attacker needed
Access to the web application; ability to submit an application form; JavaScript disabled in browser; knowledge of backup filenames
How it was found
- Intercept the request to /admin/logged and scroll down to see admin panel content.
- Disable JavaScript using the Noscript extension to access the admin panel.
- Submit an application with a stored XSS payload that breaks out of a tag and uses an onerror handler.
- Manually try common backup filenames such as apply1.php, apply2.php, applyold.php, oldapply.php.
- Upload a PHP shell to the vulnerable apply2.php file.
- Run linpeas.sh to find misconfigurations and read email files and CPanel hashes.
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 admin panel was hidden only by a script that sent visitors away, so turning off JavaScript let the attacker see it. A stored cross-site scripting (XSS) flaw meant text submitted in an application form ran as code when an admin viewed it. An old copy of a PHP file still had the file upload bug, so the attacker could upload a shell and control the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.