Skip to content
Info disclosure Write-up Beginner

Exposure Protocol: Information Disclosure in the Wild [Part 4] ️

A web application exposed a backup source file in a publicly accessible directory listed in robots.txt. An attacker could read the file and extract a hard-coded database password.

infosecwriteups.com

Published on infosecwriteups.com

Welcome to the grand finale of Exposure Protocol — a series where careless exposure meets calculated exploitation 🧠💣

Aditya Bhatt, on infosecwriteups.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, a backup copy of a source file containing hard-coded credentials was left in a web-accessible directory and its path was disclosed in robots.txt.

Impact

An attacker could obtain a hard-coded database password, potentially leading to database compromise.

What the attacker needed

None

The fix

Access to backup files should be restricted, backups should be removed from production, and credentials should not be hard-coded.

How it was found

  1. Open the lab URL.
  2. Check /robots.txt for disallowed paths.
  3. Browse to the /backup directory.
  4. Open the backup file ProductTemplate.java.bak.
  5. Find the hard-coded Postgres database password in the source code.
  6. Submit the extracted password via the lab's solution interface.

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 backup file is an extra copy of a program's code that should not be on a public website. Here, the website's robots.txt file (a file that tells search engines which pages not to visit) pointed to a folder containing such a backup. Anyone could open it and see a password written directly in the 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.