Get Domain Name
gdn is a Go module to get domain name from SSL certificates given an IP address
Installation Instructions
From Source
gdn requires go1.14+ to install successfully. Run the following command to get the repo -
▶ GO111MODULE=on go get -v github.com/kmskrishna/gdn
From Github
▶ git clone https://github.com/kmskrishna/gdn.git; cd gdn; go build; mv gdn /usr/local/bin/
Usage
You can input a list of IPs in two ways.
Filename as an argument
▶ gdn ./ips.txt
173.0.84.29 cloudmonitor.paypal.com
173.0.84.43 3ph.paypalcorp.com
173.0.84.31 pics.paypal.com
173.0.84.44 t.paypal.com
173.0.84.12 t.paypal.com
173.0.84.4 securepayments.paypal.com
173.0.84.36 securepayments.paypal.com
173.0.84.45 business.paypal.com
173.0.84.14 t.paypal.com
173.0.84.25 pics.paypal.com
173.0.84.46 t.paypal.com
173.0.84.24 demo.paypal.com
173.0.84.32 py.pl
173.0.84.9
173.0.84.13 business.paypal.com
173.0.84.6 www.paypal.com
173.0.84.16 www.paypal.com
173.0.84.34 www.paypal.com
Piping the content
▶ cat ips.txt | gdn
If you only want the Domain names in respose, it is not implemented right now but you can use the following command
▶ gdn ips.txt | awk '{print $2}' | sort -u
3ph.paypalcorp.com
business.paypal.com
cloudmonitor.paypal.com
demo.paypal.com
pics.paypal.com
py.pl
securepayments.paypal.com
t.paypal.com
www.paypal.com
This will give you unique domain names for all given IPs.
Limitations and further work
Right now gdn only takes IP addresses as inputs and only checks on port 443. In the next update will make this compatible with Project Discovery's httpx. Then you can directly pipe httpx input into gdn and get the domain/subdomain names directly.
Will also add a feature to just get the domain name and not just the subdomain name.