DEV Community

Shadrach Adongo
Shadrach Adongo

Posted on

TryHackMe TakeOver Walkthrough Easy Subdomain Takeover Room

๐ŸŽฏ Room Info

Room TakeOver
Difficulty ๐ŸŸข Easy
Category Subdomain enumeration, DNS misconfiguration, subdomain takeover
Link tryhackme.com/room/takeover

๐Ÿ“– What This Room Is About

TakeOver is built around a different kind of vulnerability than most of the rooms in this series โ€” it's not about breaking into an app's code, it's about DNS hygiene. Specifically, it covers subdomain takeover: what happens when a DNS record still points to a third-party service (like a cloud hosting platform) that the organization has stopped using or never claimed.

The room covers:

  1. ๐Ÿ” Enumerating subdomains for a target domain
  2. ๐ŸŒ Identifying a subdomain pointing to an unclaimed external service
  3. ๐Ÿด Claiming that service yourself to take control of the subdomain
  4. ๐Ÿšฉ Proving the takeover by serving your own content

This is a real, still-actively-exploited bug class โ€” subdomain takeovers regularly show up in bug bounty payouts because they're easy to miss and easy to automate discovery for.

๐Ÿง  Skills You'll Practice

  • DNS reconnaissance (dig, nslookup)
  • Subdomain enumeration tooling
  • Recognizing "dangling" CNAME records
  • Understanding how third-party service claiming works (the takeover step)

๐Ÿ› ๏ธ Step-by-Step Walkthrough

1๏ธโƒฃ Start with basic DNS recon

dig <target-domain>
nslookup <target-domain>
Enter fullscreen mode Exit fullscreen mode

Get a feel for the domain's existing records before enumerating subdomains.

2๏ธโƒฃ Enumerate subdomains

Use a subdomain brute-forcing tool against a wordlist:

gobuster dns -d <target-domain> -w /usr/share/wordlists/subdomains-top1million-5000.txt
Enter fullscreen mode Exit fullscreen mode

Or, if the room provides a specific subdomain list to check (common in TryHackMe's guided version of this room), work through it directly with dig:

dig CNAME <subdomain>.<target-domain>
Enter fullscreen mode Exit fullscreen mode

3๏ธโƒฃ Look for a "dangling" CNAME

The core of subdomain takeover: find a subdomain whose CNAME record points to an external service (like a cloud storage bucket, a PaaS app URL, or a GitHub Pages site) that doesn't actually exist anymore or was never claimed.

dig CNAME status.<target-domain>
Enter fullscreen mode Exit fullscreen mode

Example of what a vulnerable record looks like:

status.<target-domain>.  CNAME  some-unclaimed-app.exampleplatform.io.
Enter fullscreen mode Exit fullscreen mode

If visiting that subdomain in a browser shows a "not found," "no such app," or "this domain is not configured" style error from the third-party platform โ€” that's your signal. The DNS record is still live, but nothing is actually claiming that name on the platform's side.

๐Ÿ’ก Why this matters: when a company stops using a third-party service but forgets to delete the DNS record pointing to it, anyone who can register that same name on the third-party platform effectively takes control of the subdomain โ€” visitors' browsers will still resolve it and load whatever the attacker hosts there.

4๏ธโƒฃ Claim the service

The exact steps depend on which platform the dangling CNAME points to (this varies room to room โ€” could be a static site host, a PaaS platform, or a cloud storage bucket). The general pattern:

  1. Sign up for a free account on the platform the CNAME points to
  2. Create a new app/site/bucket using the exact same name referenced in the CNAME
  3. Deploy simple content (even just an index.html with a message) to prove control
curl -I http://status.<target-domain>
Enter fullscreen mode Exit fullscreen mode

Check that the response now comes from your deployed content instead of the platform's default error page.

5๏ธโƒฃ Confirm the takeover and find the flag

Once your content is live at the subdomain, the room typically confirms success either through:

  • A flag displayed directly on the platform's admin panel for the claimed service
  • A flag that appears when you successfully load the subdomain in a browser
  • A verification check built into the room itself

๐Ÿšฉ Click to reveal: flag

Redacted โ€” swap in your own captured flag if you want to keep a private record.

๐Ÿ“‹ Every Command, In Order

dig <target-domain>
nslookup <target-domain>
gobuster dns -d <target-domain> -w /usr/share/wordlists/subdomains-top1million-5000.txt
dig CNAME <subdomain>.<target-domain>
curl -I http://<subdomain>.<target-domain>
Enter fullscreen mode Exit fullscreen mode

๐ŸŽ“ Key Takeaways

  • Subdomain takeover is a DNS hygiene problem, not a code vulnerability. It happens when infrastructure gets decommissioned but the DNS pointing to it doesn't get cleaned up.
  • Dangling CNAMEs are the classic signature. Any CNAME pointing to a third-party platform is worth checking โ€” does that resource still actually exist and belong to the organization?
  • This is a real, actively-paid bug bounty category. Tools like subjack, nuclei, and dnsx automate large-scale scanning for exactly this pattern across bug bounty scopes.
  • Fixing it is simple but often forgotten: delete the DNS record the moment the underlying service is decommissioned. It costs nothing and closes the door entirely.

Top comments (0)