Skip to content
Subdomain takeover Write-up Intermediate

$XXX Bounty, How I Chained a Leaked AWS Secret Key into a Full Subdomain Takeover

A subdomain pointed to an abandoned host via a stale DNS record, and its login page source exposed AWS access keys. The keys were valid but had limited permissions, and the subdomain was vulnerable to takeover because anyone could claim the abandoned resource.

m0n3m Follow

Published on medium.com

Hey, I’m M0n3m👋🏻 — and this is the story of a bug I almost gave up on. Almost.

M0n3m, 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 stale DNS record pointing to an abandoned host, combined with hardcoded AWS credentials in the page source.

Impact

The leaked AWS keys were valid but had very limited permissions, and the stale DNS record meant an attacker could potentially take over the subdomain.

What the attacker needed

Subdomain enumeration; access to the login page; valid AWS credentials

How it was found

  1. Enumerate subdomains using online sources and a tool, then merge results.
  2. Filter live subdomains with httpx and take screenshots using Nuclei headless mode.
  3. Review screenshots and open a suspicious login page.
  4. Try default credentials, then inspect the page source.
  5. Find AWS access keys in the source and test them with AWS CLI.
  6. Report the leaked keys; later realise the subdomain is vulnerable to takeover due to a stale DNS record.

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 subdomain is a part of a website address, like blog.example.com. If that subdomain points to a server the company no longer controls, an attacker can claim that server and take over the subdomain. Here, the abandoned server's login page also had secret cloud keys in its code, which let the finder access the company's cloud account, though with limited permissions.

What is Subdomain takeover?

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.

More by m0n3m

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.