Skip to content
Info disclosure Write-up Intermediate

Red Team Recruitment Test

A password restore page on an ERP login panel leaked full database credentials via a stack trace, allowing access to phpMyAdmin and the users table. After replacing the admin password hash, the attacker logged into the admin panel and exploited a race condition in a file upload feature to achieve remote code execution.

medium.com

Published on medium.com

On March 17th, I received an email containing a web challenge for a hiring process at one of the Red Team companies. The challenge was hosted on port 56420 of an IP address, so I initially assumed it was a simple challenge that wouldn’t require port scanning or other extensive recon techniques.

Alireza Mokhtari, 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

Impact

An attacker could gain full administrative access to the application and execute arbitrary code on the server.

What the attacker needed

Valid credentials for basic auth; access to the ERP login page; ability to reach phpMyAdmin

How it was found

  1. Access the ERP login page and click 'Restore Password'.
  2. Observe the stack trace error that reveals database credentials.
  3. Use the credentials to log into a phpMyAdmin instance.
  4. Find the users table and replace the admin password hash with a newly generated one.
  5. Log into the admin panel and locate the file upload under 'Edit Profile'.
  6. Send simultaneous upload requests for a .txt file and .php files to exploit a race condition and upload a PHP shell.

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.

A stack trace is an error message that shows internal details of how a program failed. Here, it accidentally included the username and password for the database. The attacker used those to read the site's database, change the admin password, and then upload a malicious file that the server ran as code.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.