Write up about how I successfully took over the subdomain of an AWS/S3 bucket.
A Subdomain takeover is a cybersecurity vulnerability where attackers exploit abandoned or misconfigured subdomains, gaining unauthorized control. This can lead to malicious activities such as phishing, malware distribution, and defacement.
These are the steps I took to successfully take over this subdomain and link it to my own AWS bucket
The first thing to do was reconnaissance and find all the target assets I could. During this process subdomain enumeration is employed, subdomain enumeration uses a mixture of techniques to find the target sub-domains: it includes searching external data sources such as search engines, public databases, and other third-party services as well as scanning DNS records NS, MX, TXT, AXFR).
Many tools exist for this purpose and I highly suggest you setup in the tools your external data source API keys to get the maximum amount of results.
We will use the tool Subfinder but other worthy tools exist such as Sublist3r, Amass, or Knockpy.
Using Subfinder after you install, Let’s run:
docker run projectdiscovery/subfinder:latest -d mobil.com -o out.txt
We will find the output in out.txt ready for the next step.
Results from Subfinder subdomain enumeration
Many existed to check the subdomains for potential takeovers from using tools to record screenshots, to using tools to try and match text/regex right down to manually checking the domain.
We will automate the process of searching for matching text signatures using a tool called Subzy.
Assuming you have installed Subzy, let’s run:
subzy run — targets out.txt
Wait for it to complete and let’s see what we can find:
Looks like we got lucky and we can see a domain is vulnerable and we even got given a nice link to the `can-i-take-over-xyz` repository.
Now we know this domain is vulnerable let’s go over to can-i-take-over-xyz and have a look.
Success !!
We have taken over this domain/subdomain and uploaded our POC !!
A interesting bonus is look at the traffic as a bad actor we could have potentially gotten….
Hack the Planet! Stay vigilant, stay informed, and return for continuous enlightenment
Gratitude for your engagement and Remember, knowledge is the ultimate power — keep expanding!