This tool allows you to extract domains from a IP range, using the historic information archived in Virustotal (using API key). It is usefull if you want to know what domains are behind of this IP address, for example in bug bounty programs one of the first steps is to extract subdomains, this tool can help with this task… first you have to find out the IP range that uses a company. Many times a good start point is to know the AS (Autonomus system) number, then you can find the IP range.
To use this tool you have to set up your Virustotal API key in the code, please sign up on Virustotal then they provide you the API key.
Author: Juan Esteban Valencia Pantoja
iptodomain [-h] [-i FIRST_IP] [-f LAST_IP] [-w FILE2] [-o FILE1] [-v] [-r FILE3]
-h, --help show this help message and exit -i FIRST_IP The First IP of the range that you want to scan -f LAST_IP The Last IP of the range that you want to scan. -w FILE2 Please enter the file name where report with all domains and its IPs are going to save. -o FILE1 Please enter the file name where the all domains found are going to save. -v It shows more information while you are scanning. -r FILE3 Please enter the name of the final Report without duplicate domains results
iptodomain Usage Example
The task is to find out a list of all sites hosted on the same IP as the site suip.biz. We recognize the IP site suip.biz:
dig +short suip.biz 126.96.36.199
Set the beginning of the scan range (-i 188.8.131.52) and the end of the scan range (-f 184.108.40.206), the results – domains together with the IP will be saved to a file (-w /tmp/t.txt):
iptodomain -i 220.127.116.11 -f 18.104.22.168 -w /tmp/t.txt www.suip.biz www.compforman.ru suip.biz softocracy.ru mail.suip.biz mail.softocracy.ru
Find all the domain names that are in the range from IP (-i 22.214.171.124) to IP (-f 126.96.36.199), save the results – only domain names – to the file (-o 188.8.131.52.txt), during the scan show More information (-v) and save the final report without duplicates to a file (-r IPsCF.txt):
iptodomain -i 184.108.40.206 -f 220.127.116.11 -o 18.104.22.168.txt -v -r IPsCF.txt
How to install iptodomain
Installation on Kali Linux
git clone https://github.com/jevalenciap/iptodomain.git cd iptodomain/ sed -i '1s/^/#! \/usr\/bin\/env python2\n/' iptodomain.py sudo chmod +x iptodomain.py sudo mv iptodomain.py /usr/local/bin/iptodomain cd iptodomain