Skip to content
Subdomain takeover Write-up Intermediate

How I Found an Open AWS S3 Bucket and Used It to Take Over a Subd

An unclaimed AWS S3 bucket was referenced by a subdomain, allowing the researcher to claim it and host a proof-of-concept file. This resulted in a subdomain takeover, as the subdomain then served the researcher's content.

Boubker Chamekh Follow

Published on medium.com

My name is Boubker Chamekh, and I am from Morocco. My philosophy in life is to be patient until you achieve your goals, and this approach has helped me in my bug-hunting journey.

Boubker Chamekh, 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 dangling CNAME record pointing to an unclaimed AWS S3 bucket.

Impact

An attacker could take over a subdomain and host arbitrary content, potentially damaging the organisation's reputation or enabling further attacks.

What the attacker needed

Subdomain with dangling CNAME to S3; unclaimed S3 bucket

The fix

The organisation should remove the dangling CNAME record or reclaim the S3 bucket.

How it was found

  1. Enumerate subdomains and find CNAME records pointing to a developer domain.
  2. Access a subdomain and discover an API endpoint that lists streamers and their S3 buckets.
  3. Check S3 buckets for public access; find one open bucket and one unclaimed bucket.
  4. Inspect the open bucket's content and find a reference to another S3 bucket.
  5. Claim the unclaimed S3 bucket and upload a proof-of-concept file.
  6. Observe that the subdomain now serves the uploaded file, confirming takeover.

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 takeover happens when a website points a subdomain to an external service, like an S3 bucket, but that service is no longer controlled by the website owner. An attacker can claim the unused service and control what appears on that subdomain. Here, the researcher found an unclaimed S3 bucket and took it over.

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.

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.