Subdomain Takeover
One of the easiest ways to spot a subdomain takeover vulnerability is by the error message.
Subdomain Takeover

Occurs when a subdomain is pointing to another domain (CNAME) that no longer exists.
An attacker can then register the non-existing domain. Now the target subdomain will point to a domain the attacker controls.
A bunch of examples and walkthroughs on exploiting different providers:
GitHub Takeover

After we have an indicator that this site is vulnerable we need to get the GitHub page the vulnerable subdomain is pointing to. We need this information so we can register the domain through github.
Use the "dig" command to gather the DNS records of the vulnerable domain.
If the domain points to the github page, try to register a domain on Github.
Steps to register a domain on Github:
Create a Github repo with the same name as the CNAME record.
Create an “index.html” file in the repo.
Set the repo as the main branch.
set the custom domain to the target domain you are going after.
When you visit the target domain you should see the page you set up.
SWAP Tabs
Last updated