![Kali Linux Network Scanning Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/179/36701179/b_36701179.jpg)
Brute-force
Where the dnsenum command really shines is brute-forcing, which it does recursively. This means that when it identifies subdomain.domain.com, it will start brute-forcing subdomain.subdomain.domain.com. Obviously, this can take a while even though it is a multithreaded script.
In the next example, we will use the dnsenum command to brute-force subdomains, but first, we need a list of subdomains for dnsenum to use. There is a very interesting project called dnspop that identifies top subdomains.
The project can be found here at https://github.com/bitquark/dnspop. We do not need to download and install the Python script, as the results are also published at https://github.com/bitquark/dnspop/tree/master/results. I have downloaded the list with the top 1,000 most popular subdomains and placed it in the /usr/share/wordlists/subdomains/ directory.
Now we have a list of names dnsenum can use to brute-force with. The command to brute-force subdomains uses the file (-f) flag followed by the file path/name and, if you want, the recursive (-r) flag to enumerate the subdomains recursively. The command looks like this:
dnsenum -f /usr/share/wordlists/subdomains/subdomains_popular_1000 -r google.com
The aforementioned command does the following:
- First, the dnsenum command performs the default lookups:
- Next, dnsenum begins brute-forcing subdomains:
![](https://epubservercos.yuewen.com/B47322/19470409201646106/epubprivate/OEBPS/Images/Screenshot-from-2017-04-11-10-39-42-1024x704.png?sign=1738910583-TUHnAYmohvaoXRzDDXjKTs2dBoT8VpGx-0-4f2c0056e4de9d443a959bb4fb3ea8b9)
- Once it has completed brute-forcing the subdomains, it will begin brute-forcing recursively:
![](https://epubservercos.yuewen.com/B47322/19470409201646106/epubprivate/OEBPS/Images/Screenshot-from-2017-04-11-10-40-28-1024x704.png?sign=1738910583-n9NKIKjVmOu2T83xnRb30nGWFMqWs2nT-0-41ec0a570454f1bc33a4312ca3eb7ca7)