How to find all subdomains of a site

Hacker

Professional
Messages
1,041
Reaction score
852
Points
113
Today we will talk about finding subdomains-an integral part of preparing for hacking, and thanks to some tools, countering these actions has become much easier. Subdomains may contain a vulnerable script, admin panel, etc., which can help us in hacking the site.
In the latest incident, the entire code of the Vine site could be downloaded from an unprotected subdomain.
If you are a website owner or are studying information security issues, you can use the following tools to find subdomains of any domain.

1. Censys
First of all, they usually use Censys to search for subdomains. In addition to the subdomain, you can find many other interesting things, such as:
  • IP data (can be useful for finding a real IP address);
  • certificate details;
  • open ports;
  • SSL / TLS handshake protocol and encryption algorithms (useful when searching for weak ciphers/protocols).
d46591e6cd7e4dc9bf39627d9afe7abd.png


You'll get a good overview of your domain information.

2. Pentest-Tools
Using Pentest-Tools, you can use several methods when searching for a subdomain, for example: passing a DNS zone, searching DNS based on a list of words, or using a search engine.
d7ab5eef846b4ceb8d25f3b8cb0c0f9e.png


The search results can be saved in PDF format.

3. DNS Dumpster
DNS Dumpster is a tool for finding domain and host information. Project authors - HackerTarget.com.
You can find information not only about the subdomain, but also about the DNS server, MX and TXT records, as well as get a graphical representation of information about your domain.
97caf838dbf546aa952117a3ce1b3799.png


4. Sublist3r
5327587aae04a161836d8.png

Sublist3r is a Python tool for detecting subdomains using search engines. Today Sublist3r supports Google, Yahoo, Bing, Baidu, Ask, Netcraft, Virustotal, ThreatCrowd, DNSdumpster and PassiveDNS.
Sublist3r only supports Python version 2.7 and depends on several libraries.
You can use this tool on Windows, CentOS, RedHat, Ubuntu, Debian, and any other UNIX-based OS. The following is an example for CentOS.
Log in to your Linux server;
Download the latest version of Sublist3r
Code:
wget https://github.com/aboul3la/Sublist3r/archive/master.zip

Unzip the downloaded file:
Code:
unzip master.zip

A new folder “Sublist3r-master "will be created.”
As I mentioned earlier, there are the following dependencies that you can use the yum command to install:
Code:
yum install python-requests python-argparse

You are now ready to detect subdomains with the following command:
Code:
./sublist3r.py -d yourdomain.com

d07acd953a164c0581ed3fe1b934f5c5.png


As you can see, the tool detected my subdomains.

5. Netcraft
Netcraft has an extensive database of domains and should not be ignored when searching for open information about subdomains.
18e503be6e4f44a69a54ee04376c7316.png


The search result will contain all information about the domain and subdomains, including the date of the first view, the address range, and information about the operating system. If you need to get more information about the site, just open the site report and you will be provided with a lot of information about technologies, rating, etc.
53d9b682cb164979bc461a7554d5c438.png


6. CloudPiercer
CloudPiercer can sometimes be useful when searching for information about whether a subdomain of your domain exists. By the way, CloudPiercer is an awesome and easy way to find out if your site's actual IP address is protected. Public IP address information makes your site vulnerable to DDoS attacks.

7. Detectify
Detectify searches for subdomains using a predefined list of several hundred words, but only if you are the owner of the domain. However, if you are a registered Detectify user, you can enable the subdomain detection feature in the overview section of settings.
1df23bc885384f168eedce7816badaf8.png


8. SubBrute
3c73b6ff5ca991ce33a86.png

SubBrute is one of the most popular and accurate subdomain enumeration tools. The project is developed by the community and uses an open name resolver as a proxy, so that SubBrute does not send traffic to the target DNS server.
It's not an online tool, so you'll have to install it on your computer. SubBrute can be used on Windows or UNIX systems. The program is very easy to install. Below is an example for CentOS / Linux.

Log in to your Linux server
Download the latest version of SubBrute
Code:
wget https://github.com/TheRook/subbrute/archive/master.zip

Unzip the downloaded zip file
Code:
unzip master.zip

A new folder “subbrute-master " will be created. Go to the folder and execute subbrute.py with the required domain.
Code:
./subbrute.py yourdomain.com

The operation will take a few seconds and the found subdomains will be displayed.

9. Knock
d4098db7936d02c8a5adf.png

Knock is another Python tool for detecting subdomains. It is tested for Python 2.7.6. Knock finds subdomains of the target domain from a list of words.

Knock can be installed on a Linux-based OS.
Code:
wget https://github.com/guelfoweb/knock/archive/knock3.zip

Unzip the downloaded zip file with the unzip command
Code:
unzip knock3.zip

As a result, a new folder “knock-knock3 "will be created.”
Go to the folder and install using the following command
Code:
python setup.py install

After installation, you can search for subdomains as follows:
Code:
./knockpy.py yourdomain.com

10. DNSRecon for Kali Linux
Kali Linux is an excellent platform for evaluating information security and you can use DNSRecon on it without installing any additional tools.
DNSRecon checks all NS records for zone changes, shared DNS records, template processing, PTR records, and so on.

To use DNSRecon, simply run the following command
Code:
dnsrecon –d yourdomain.com

54a23a54dce04bb2920215cc37985813.png

I hope that using the tools listed above, you will be able to detect subdomains of the target domain as part of your information security assessment work.

Images: cryptoworld.su
 
Top