Subdomain Takeover Guide
Subdomain Takeover Guide
BY
Touhid M.Shaikh
Special Thanks!!
We are InitD
Harshal Ghaisas - Logo Designer
Shrutirupa Banerjiee, Sachin Sase and
Sagar Sharma - Members
TABLE OF
contents
1. Introduction
2. What is Subdomain?
3. What is Subdomain Takeover?
4. All About CNAME.
5. How to find CNAME Records?
6. What is Subdomain Takeover Lab?
7. Let's Takeover Subdomain.
Github Pages
AWS S3 Bucket
Tilda
8. Mitigation
9. Bibliography
INTRODUCTION
1
What is Subdomain?
(Fig: 1).
2
What is Subdomain Takeover?
Scenario Example:
When a company or individual has
configured a DNS CNAME entry for one of its
subdomains pointing to an external service
(ex: Heroku, Github Pages, Bitbucket, Tilda,
AWS S3 Bucket, Shopify, etc) but the service is
no longer utilized by that company. In that
condition, An attacker could register to the
external service and claim the affected
subdomain to configure his/her service's to
point affected subdomain.
3
All About CNAME
4
How to find CNAME records?
DNS Server: Here we can use any DNS Server. I have used the
Google Public DNS(8.8.8.8) Server name. But you can use any
of DNS servers like Your Private DNS server or any
Anonymous DNS server name also.
5
How to find CNAME records? (cont'd)
OUTPUT:
6
How to find CNAME records? (cont'd)
Host Command
$ host syed.subdomain-takeover.tk
OUTPUT:
7
What is Subdomain Takeover Lab?
Subdomain Takeover Lab is Initiative of InitD Community for all(Infosec Guys). Here, its
legal to takeover subdomain and host anything(Read Rules). Hackers can explore thier
Subdomain Takeover Skills with a vulnerable subdomain of subdomain-takeover.tk
domain. You can find more than 100 subdomain which is Mis-Configured DNS record
such as CNAME, MX, NS records.
Github Pages
In above an image. we got 404 Error page. its means, this subdomain has no longer
Github Page.
In short, we can claim this Subdomain by pointing our GitHub page to this subdomain.
Let’s confirm CNAME records by Dig Command.
And you can use HTTPS connection. i just avoid Enforce HTTPS .
Now Visit beta.subdomain-takeover.tk
You Need to add a CNAME file with your desired subdomain name.
AWS S3 Bucket
Now You Need a AWS Account to create a Bucket and claim this subdomain.
Login to https://console.aws.amazon.com/
Set Bucket name to source domain name (i.e., the domain you want to take over)
Click Next multiple times to finish.
Click Upload
Select the file which will be used for PoC (HTML or TXT file). I recommend naming it
differently than index.html; you can use PoC (without extension)
In Set Permissions tab select Grant public read access to this object(s)
In Header, select Content-Type and value should reflect the type of document which
you going to upload. In Our Case HTML, choose text/html.
Click to Upload.
If Everything done properly. You’ll Get the subdomain. Lets visit and verify successful
takeover.
Congratulation !!
For Tilda, You need a premium account or at least a Feel Trail Account on https://tilda.cc
(We Recommend a Premium Account)
Lets Visit Vulnerable domain and check its available for takeover or not.
Let’s Takeover.
I am Assuming
Go To Site setting
Click on Domain
Type You Subdomain Name a Click on Save changes.
Congratulation.
Mitigation
Bibliography
https://github.com/EdOverflow/can-i-take-over-xyz
Please Try or Subdomain Takeover LAB which is in BETA testing. If you Find any
Difficulties please let us know.
END