Subdomain Takeover guides, methodology and exploit POCs

Aditya Narayan
2 min read2 days ago

--

Another day in Bug Bounty journey, today I learned about Subdomain TakeOver vulnerability.

To sum it up, I’ll explain the cause, exploitation methodology and preventive measures.

Subdomain TakeOver

Cause:

  • A subdomain takeover happens when a subdomain points to an unused or misconfigured third-party service, and an attacker claims the resource.
  • The attacker can claim the abandoned resource (e.g., register the same service) and gain control of the subdomain.

Exploitation Methodology:

  1. Discovery: Attackers identify subdomains pointing to inactive third-party services using tools like dig and nslookup that allows them their CNAME.
  2. Claiming: They register the same service (e.g., an AWS S3 bucket or Github Pages) to gain control.
  3. Exploitation: The attacker uploads malicious content, making the subdomain appear legitimate.

Preventive Measures (from GPT):

  1. Check DNS records regularly and remove unused subdomains.
  2. Verify subdomain ownership to ensure control over linked resources.
  3. Use monitoring tools to detect orphaned subdomains.
  4. Avoid wildcard DNS records unless necessary.

These measures help prevent subdomain takeover risks.

How to look for this vuln…?

Well, I prefer to keep a separate list of all the subdomains that throws a 404 error during the initial subdomain enumeration stage.

This allows me to have a list of subdomains that I can primarily check for Subdomain Takeovers.

Presence of all the 404s indicate that there used to be a service this was redirected to which is no longer present, hence we can register in its place and takeover the subdomain.

For reference, there’s a lot of articles, videos and reports I read which I’ll link below.

YouTube Videos :

Medium Articles :

All about Subdomain Takeovers

--

--

Aditya Narayan
Aditya Narayan

Written by Aditya Narayan

Posting Bug Bounty methodology, POCs, tips. My socials : https://linktr.ee/adityans

No responses yet