Skip to content
Info disclosure Write-up Beginner

From Internal IP Discovery to Full Database Dump

An exposed internal IP address served a directory listing of the application's source code, including a .git directory and a .env file with secrets. The leaked PostgreSQL credentials allowed the author to connect to the production database and access PII for nearly 12,000 users.

medium.com

Published on medium.com

In this write-up, I’ll walk through my findings, the steps taken to exploit the vulnerability.

dotHatab, 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

Root cause

Likely a misconfigured web server that exposed directory listings and sensitive files such as .git and .env to the internet.

Impact

The author could access PII for nearly 12,000 users, and cross-checking with Have I Been Pwned suggested some accounts may be taken over if leaked passwords are reused.

What the attacker needed

Internet access to the exposed IP; no authentication required

How it was found

  1. Found an internal IP address via Shodan that exposed a directory listing.
  2. Browsed the exposed files, including .git, .env, and configuration directories.
  3. Used clues from the source code to find a related GitHub repository with more secrets.
  4. Used leaked PostgreSQL credentials to connect to the production database.
  5. Queried the database and found a file with PII for nearly 12,000 users.

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 server was left with directory listing turned on, so anyone who found its address could browse the files. Those files included secret keys and database passwords, which let the author log straight into the database and read personal data about users.

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.