Table of Contents
Network Recon 101
So you have decided to investigate a web site. This could be for any of a multitude of reasons, all of which are Irrelevant to the purposes of this article. The point is, this hypothetical site and its staff are asking for it, and you are about to give it to them.
Lets say this site is, hypothetically, scanme.nmap.org. So where to begin? Before you can start to do anything (dox, attack, shut down, etc) you first need to run some basic tools. You have to profile where this site intersects with the rest of the internet, and the real world.
Finding IP Addresses & DNS Info
Every machine (or host) on the internet has an IP address, and every domain name resolves to an IP address. Domain names are only aliases for IP addresses because whatever.com is easier to remember than 187.158.173.109. The inverse is not necessarily true. An IP may have no domain name pointing to it.
Also note that several different sites under different domains can share an IP. Furthermore, different subdomains on the same domain name can resolve to different IP addresses.
There are a handful of basic commands in *nix/Windows/MacOS that can reveal a site's IP address. Note that all of these commands will require Terminal or PowerShell.
ping
The classic ping
command works on pretty much everyone's machine, without having to install anything. It functions by sending a simple echo request to the IP address or domain name specified, and waiting to receive a reply back. While this command is most useful for diagnosing connection issues, a ping will also reveal the host IP address for a given domain:
$ ping scanme.nmap.org
With the IP in the response:
PING scanme.nmap.org (45.33.32.156) 56(84) bytes of data. 64 bytes from scanme.nmap.org (45.33.32.156): icmp_seq=1 ttl=52 time=84.4 ms 64 bytes from scanme.nmap.org (45.33.32.156): icmp_seq=2 ttl=52 time=83.6 ms 64 bytes from scanme.nmap.org (45.33.32.156): icmp_seq=3 ttl=52 time=89.7 ms
What if we send a ping to the root domain?
$ ping nmap.org PING nmap.org (50.116.1.184) 56(84) bytes of data. 64 bytes from ack.nmap.org (50.116.1.184): icmp_seq=1 ttl=53 time=84.7 ms 64 bytes from ack.nmap.org (50.116.1.184): icmp_seq=2 ttl=53 time=90.6 ms 64 bytes from ack.nmap.org (50.116.1.184): icmp_seq=3 ttl=53 time=86.6 ms
It reveals that Nmap's home page and ScanMe service run on two separate IP addresses! This is incredibly useful knowledge, for anyone conducting hypothetical attacks on Nmap's servers.
nslookup
Another commonly bundled cross-platform command, nslookup
checks DNS records to find the IP address formally associated with a given domain:
$ nslookup scanme.nmap.org Non-authoritative answer: Name: scanme.nmap.org Address: 45.33.32.156 Name: scanme.nmap.org Address: 2600:3c01::f03c:91ff:fe18:bb2f
You can also use it to find a hostname associated with a given IP address:
$ nslookup 45.33.32.156 156.32.33.45.in-addr.arpa name = scanme.nmap.org.
Click here to read more nslookup
command examples.
host
Sorry Windows users, but this one is for *nix systems (Unix, Linux, BSD, MacOS). The host
command (much like nslookup
) is a quick way look up DNS information on domains and IP addresses:
$ host scanme.nmap.org scanme.nmap.org has address 45.33.32.156 scanme.nmap.org has IPv6 address 2600:3c01::f03c:91ff:fe18:bb2f $ host 45.33.32.156 156.32.33.45.in-addr.arpa domain name pointer scanme.nmap.org.
Things we already knew. But what if we run host
on the root domain?
$ host nmap.org nmap.org has address 50.116.1.184 nmap.org has IPv6 address 2600:3c01:e000:3e6::6d4e:7061 nmap.org mail is handled by 1 aspmx.l.google.com. nmap.org mail is handled by 5 alt1.aspmx.l.google.com. nmap.org mail is handled by 5 alt2.aspmx.l.google.com. nmap.org mail is handled by 10 aspmx2.googlemail.com. nmap.org mail is handled by 10 aspmx3.googlemail.com. $ host 50.116.1.184 184.1.116.50.in-addr.arpa domain name pointer ack.nmap.org.
A treasure trove of information. Turns out the Nmap project is using Google Workspace to manage their email and who knows what else. Wild!
dig
Another popular *nix utility is the dig
command:
$ dig scanme.nmap.org
Which reveals the IP address in the “Answer Section”:
;; ANSWER SECTION: scanme.nmap.org. 1943 IN A 45.33.32.156
You can force dig
to use specific DNS servers, instead of your local default. For example, to query Quad9 about Nmap, you would run:
$ dig @9.9.9.9 scanme.nmap.org
It can also do reverse DNS lookups:
$ dig -x 45.33.32.156 ... ;; QUESTION SECTION: ;156.32.33.45.in-addr.arpa. IN PTR ;; ANSWER SECTION: 156.32.33.45.in-addr.arpa. 300 IN PTR scanme.nmap.org.
Read more dig command examples.
WHOIS
WHOIS is a query and response protocol that is used for querying databases that store an Internet resource's registered users or assignees. These resources include domain names, IP address blocks and autonomous systems, but it is also used for a wider range of other information. The protocol stores and delivers database content in a human-readable format.
WHOIS lookups are a great way to find out more information about a web site or IP address. They can clue you in to who the target uses for a host or domain registrar, geographic locations, and sometimes even the real-world names & addresses of the site owners or administrators. WHOIS lookups are a necessary fundamental skill for recon and doxxing.
Domain Information
WHOIS lookups are extremely easy to do. That's what the whois
command is for. Every domain registrar runs a WHOIS database for the domains it is hosting. These databases usually contain information about the owner & assigned contacts of the domain, such as email, phone, and street address. Keep in mind that some domain owners will lie about this, which can be grounds for domain suspension, but it is hardly enforced. Some domain owners subscribe to privacy services (such as Domains by Proxy or Withheld for Privacy) in which case you will have to try another way to get the information.
whois
generally doesn't like being run against subdomains, so you will have to point it at the root domain:
$ whois nmap.org
The lengthy results of this command (which we will not paste here) reveal that Nmap does in fact use one of the aforementioned domain privacy services. It also shows that they use Dynadot as a domain registrar, which in turn points to Linode's nameservers, revealing two more of their service providers.
More IP Information
whois
can be run against IP addresses as well:
$ whois 45.33.32.156
Running whois
against either of Nmap's IP addresses brings up more information about Nmap's host, including the email address to send abuse and DMCA shutdown notices to. (Very exploitable.)
Browser Based Tools
If you don't have access to the command line, there are a handful of sites you can use for DNS & WHOIS lookups in your browser:
More Things You Can Do
Congratulations! You have now done the absolute bare minimum it takes to profile a web site. But what to do with this information? There are several directions in which you can proceed:
- You can compile the info you found into a dox file for the target.
- You can run a port scan on the host(s) to further profile the server environment(s) of the target.
Find this page online at: https://bestpoint.institute/diy/network-recon