Subdomain takeover via AWS s3 bucket
A subdomain pointed at an AWS S3 bucket that no longer existed, so anyone could register a bucket with the same name and serve content on that subdomain. An attacker could host phishing pages or redirect users on the organisation's own domain.
infosecwriteups.com
Published on infosecwriteups.com
Today we are going to talk about the Subdomain takeover vulnerability which can be easily identified and exploited by attackers causing maximum impact to the organization.
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 DNS record still pointing at an S3 bucket that was deleted, leaving the bucket name free for anyone to claim.
Impact
An attacker could serve their own content on the organisation's subdomain, enabling phishing or cookie theft against its users.
What the attacker needed
Dangling DNS record to a deleted bucket; bucket name free to register; AWS account
The fix
The dangling DNS record should be removed or repointed, and bucket names should be re-registered before deletion so they cannot be claimed by others.
How it was found
- Enumerate subdomains and check which ones respond.
- Run a takeover scanner that matches response fingerprints to known vulnerable services.
- Look for a response indicating the S3 bucket does not exist.
- Resolve the host to find its IP addresses.
- Look up the IP to learn the AWS region of the bucket.
- Create a bucket with the same name in that region, enable public access and static web hosting.
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 website's subdomain can be set up to point at a cloud storage bucket (here, Amazon S3). If the bucket is deleted but the DNS record still points at it, anyone can create a bucket with that same name and put their own files there. Visitors to the subdomain then see the attacker's content, which looks like it belongs to the real organisation.
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.