Skip to content
Leaked secrets Write-up Beginner

How i found exposed db creds on .gov site

A WordPress backup configuration file was publicly accessible on a subdomain, exposing database credentials, authentication keys and salts. An attacker could use these secrets to attempt to access the database or forge authentication cookies, though the database was on an internal network and cookie forgery attempts failed.

jenroots Follow

Published on medium.com

This is my first blog and the story of my first find. I am still new and learning every day so any feedback is appreciated… I will try to keep this short and simple — let’s get into it.

Jenroots, 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 backup copy of the WordPress configuration file was left in the web root and served publicly.

Impact

The exposed secrets could allow database access or login bypass, but the database was on an internal network and the cookie forgery attempts were unsuccessful, limiting immediate impact.

What the attacker needed

None

The fix

The issue was mitigated, likely by removing the publicly accessible backup file and rotating the exposed credentials and keys.

How it was found

  1. Enumerate subdomains of the target domain.
  2. Probe the subdomains for live web servers and technologies.
  3. Run Nuclei against the live URLs.
  4. Notice Nuclei flagged an exposed WordPress configuration backup file.
  5. Download the backup file and read the exposed credentials and keys.
  6. Use WPScan to find usernames and attempt to forge authentication cookies with the exposed keys.

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 WordPress site keeps its main settings in a file called wp-config.php, which includes the password for its database and secret keys used to sign login cookies. Here, a backup copy of that file was left on the web server where anyone could download it. That gave away secrets that could let someone break into the site or its database if they could reach them.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.