![Kali Linux:An Ethical Hacker's Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/772/36698772/b_36698772.jpg)
上QQ阅读APP看书,第一时间看更新
Subfinder
Subfinder is considered as a successor to sublist3r. It is amazingly fast and finds valid subdomains using passive online sources such as Ask, Archive.is, Baidu, Bing, Censys, CertDB, CertSpotter, Commoncrawl, CrtSH, DnsDB and so on.
- Install subfinder. It needs Go to be installed, which we can install by using the following command:
apt install golang
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/d581d372-398e-4d7b-8f2d-4bc7afe54b50.png?sign=1738838531-YnNIeBvE4suoViLgCcCLPLlPBeea1T95-0-07258b60e8c684a78b54e0fc79879ed4)
- Next, we clone subfinder by using the following command:
git clone https://github.com/subfinder/subfinder.git
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/aeb7ce96-43d4-4601-aada-05e2beea9a72.png?sign=1738838531-GLXk1qERUukhTz8YDnd6OFgw02EtGCR0-0-0a39f2d281a71baa4145d79fda3f3776)
Or you can download and save it from https://github.com/subfinder/subfinder.
- To install subfinder, we go to the cloned directory and run the go build command.
- Once the installation is complete, we will need a wordlist for it to run, so we can download dnspop's list. This list can be used in the previous recipe too: https://github.com/bitquark/dnspop/tree/master/results.
- Now that both are set up, we browse into subfinder's directory and run it using the ./subfinder -h command.
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/dbe88235-1059-4b6d-9389-38803ebfb83e.png?sign=1738838531-hJ6fGkLH1WmB0d1z1Oybgtm8y0qIguJN-0-8e81399fbdca9fb91faec8894bedf70f)
- To run it against a domain with our wordlist, we use the following command:
./subfinder -w /path/to/wordlist -d hostname.com
If we do not specify a wordlist the tool will run with a default wordlist as shown in the following screenshot:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/b7dd71df-481a-4f82-be66-df443ed82315.png?sign=1738838531-QpITg4KcvQQHt77p7J0j94j5BasET2sh-0-498e218a3b685da0b77b1b133ca5b540)
Once the enumeration is complete, the output will be shown onscreen as follows:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/cdd181a6-7af3-44d2-b82d-adf3dc066a3d.png?sign=1738838531-xUwmqbg6SlpkSjsOb6Q54yRt9og8hiYH-0-b7077a0578a3ba37006609111da49fb8)
- Subfinder is also designed to work with services such as shodan, censys, and virustotal, but they need to be configured in the config.json file shown here:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/e88c658b-f026-4f64-92ae-e909bc881b8e.png?sign=1738838531-RxMoEA6wCkJJHnxgBcMuBUnJ8R0Sqcnn-0-05d6b7de2599b77f2e70b313510acfe5)