Hey guys, it’s me @dheerajydv19 and in today’s blog, we will be learning about how to find subdomains for large-scale reconnaissance.
We have already discussed some of the tools in one of my recently published blogs, so I won’t be repeating those tools, you can read that blog using the link below.
The tools we will be using are -
Some other web-based tools are DNSDumpster and nmmapper and a few we have already discussed in the last blog.
It is an awesome tool for subdomain enumeration by the project discovery team.
Cloning the GitHub repo using the below command.
git clone https://github.com/projectdiscovery/subfinder
Moving to the main folder.
Checking if the installation has been done correctly by parsing the help command.
If the help module is displayed correctly, congo you have done the installation successfully.
Note - You can install subfinder using go by giving the below command but it requires go1.18 to install successfully. I personally love git so I always prefer that for installing the tools wherever I can.
For finding subdomains of a single domain, use the command -
subfinder -d mydomain.com
For scanning a list of domains -
subfinder -dL /path/to/domain/list.txt -o /path/to/output.txt
For example, if I have all the domains in a file named domains.txt, which is located at Desktop, the command would be -
subfinder -dL ~/Desktop/domains.txt -o ~/Desktop/subdomains.txt
Check out https://github.com/projectdiscovery/subfinder#usage for understanding all the usage commands.
It is an awesome tool for in-depth attack mapping and subdomain enumeration.
For installing it via apt give the below command to your Linux terminal.
sudo apt install amass
For checking if it’s installed successfully, enter
amass in your Linux terminal.
Note - You can install it by downloading it from GitHub too, but that’s little trick work, so prefer installation via apt.
For basic subdomain enumeration
amass enum -d example.com
For recursive subdomain enumeration
amass enum -d example.com -norecursive
Enumerate subdomains with additional data sources
amass enum -d example.com -active -brute -passive
Enumerate subdomains and write output to a file
amass enum -d example.com -o output.txt
You can read the manual guide for amass at the below link -
You can simply install it in a single command by using apt, enter the below command in your linux terminal.
sudo apt install theharvester
Alnternatively, you can also install it from github repo which is given below.
For checking if the installation is done correctly, parse
theHarvester in your Linux terminal.
- Enumerate subdomains from multiple sources
theHarvester -d example.com -l 500 -b all
- Basic subdomain enumeration
theHarvester -d example.com -l 500 -b google
- Enumerate subdomains and write output to a file
theHarvester -d example.com -l 500 -b all -f output.txt
Note - It has a lot of modules for subdomain enumeration, some of them require while others work perfectly, so if you want to get the best from it, prefer setting up all the API and then start using it.
You can simply install it in a single command by using apt and entering the below command in your Linux terminal.
sudo apt install sublist3r
Alnternatively, you can also install it from the GitHub repo which is given below.
- Basic subdomain enumeration
python sublist3r.py -d example.com
- Enumerate subdomains from a specified DNS server
python sublist3r.py -d example.com -s 188.8.131.52
Note - I personally tried using sublist3r yesterday and it was giving some error due to virus total, so if you can solve that issue, go ahead otherwise prefer using any other tool.
You guys can try using the remaining three tools yourself, they are a little outdated and I personally also don’t use those tools, so I am not writing about those in this blog.
There are many other tools for subdomain enumeration, so try some and decide for yourself which you want to use according to your needs and requirements. I personally love subfinder so must give it a try to that. If you guys have one more blog on this topic about what’s next after subdomains, then let me know on Twitter, so tell me here in the comments.
That’s it for today’s blog.
Follow me on Twitter: https://twitter.com/Dheerajydv19