DNS Reconnaissance using nmap
In a penetration test (PenTest) a thorough reconnaissance is critical to the overall success of the project.
DNS information for the target network is often very useful reconnaissance information. DNS information is publicly available information and enumerating it from DNS servers does not require any contact with the target and will not tip off the target company to any activities.
A tool that can be used to assist with DNS information gathering is nmap. Nmap has a parallel reverse DNS resolution engine that is normally employed as part of an nmap scan, but can also be used independently of the scan function to do DNS enumeration.
Let’s pretend we were hired to do a pentest against SANS. www.sans.org is 66.35.59.202. According to ARIN whois 66.35.59.202 is part of a /24 range allocated to the SANS (66.35.59.0/24). ARIN also shows another /24 network range allocated to SANS (204.51.94.0/24).
From http://whois.arin.net/rest/org/SANSI-1/nets/
The nmap command to be used in this case is:
# nmap --dns-servers 8.8.8.8,8.8.4.4 -sL 204.51.94.0/24 66.35.59.0/24
By default nmap will use your system’s configured DNS. If you are enumerating a large address space nmap can generate a high volume of queries. While this shouldn’t cause an issue for your DNS servers, being paranoid, I use publicly available servers that I know can handle the volume. In this case Google’s public DNS at 8.8.8.8 and 8.8.4.4 or OpenDNS. These servers are specified using the –dns-servers parameter.
-sL specifies a list scan, which means nmap will only do a DNS resolution, not actually scan the target.
204.51.94.0/24 66.35.59.0/24 is the target networks we want to enumerate. In nmap if multiple address ranges are to be part of the target they are space separated.
The output is one line per IP in the range (heavily edited for space). Notice that every IP with a reverse DNS entry has that entry listed. IPs without reverse DNS entries just show the IP.
Starting Nmap 5.51 ( http://nmap.org ) at 2015-11-08 13:39 EST
Nmap scan report for 204-51-93-0.clp.sans.org (204.51.94.0)
Nmap scan report for router31-int.clp.sans.org (204.51.94.1)
Nmap scan report for fw31.clp.sans.org (204.51.94.2)
…
Nmap scan report for 204.51.94.43
Nmap scan report for 204.51.94.44
…
Nmap scan report for portal.sans.org (204.51.94.201)
Nmap scan report for mail.sans.org (204.51.94.202)
Nmap scan report for exams.giac.org (204.51.94.203)
Nmap scan report for www.giac.org (204.51.94.204)
…
Nmap scan report for www.sans.org (66.35.59.202)
Nmap scan report for exams.giac.org (66.35.59.203)
Nmap scan report for www.giac.org (66.35.59.204)
…
Nmap scan report for dshield.org (66.35.59.248)
Nmap scan report for isc.sans.org (66.35.59.249)
Nmap scan report for isc.sans.org (66.35.59.250)
Nmap scan report for isc.sans.org (66.35.59.251)
…
Nmap done: 512 IP addresses (0 hosts up) scanned in 58.98 seconds
DNS information is publicly available information, so enumerating it is not a crime in any jurisdiction that I am aware of. If you really feel the need to go further than this, please remember that the difference between an attack and a pentest is permission.
-- Rick Wanner MSISE - rwanner at isc dot sans dot edu - http://namedeplume.blogspot.com/ - Twitter:namedeplume (Protected)
Comments
Anonymous
Dec 3rd 2022
9 months ago
Anonymous
Dec 3rd 2022
9 months ago
<a hreaf="https://technolytical.com/">the social network</a> is described as follows because they respect your privacy and keep your data secure. The social networks are not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go.
<a hreaf="https://technolytical.com/">the social network</a> is not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go. The social networks only collect the minimum amount of information required for the service that they provide. Your personal information is kept private, and is never shared with other companies without your permission
Anonymous
Dec 26th 2022
9 months ago
Anonymous
Dec 26th 2022
9 months ago
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
Anonymous
Dec 26th 2022
9 months ago
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
Anonymous
Dec 26th 2022
9 months ago
Anonymous
Dec 26th 2022
9 months ago
https://defineprogramming.com/
Dec 26th 2022
9 months ago
distribute malware. Even if the URL listed on the ad shows a legitimate website, subsequent ad traffic can easily lead to a fake page. Different types of malware are distributed in this manner. I've seen IcedID (Bokbot), Gozi/ISFB, and various information stealers distributed through fake software websites that were provided through Google ad traffic. I submitted malicious files from this example to VirusTotal and found a low rate of detection, with some files not showing as malware at all. Additionally, domains associated with this infection frequently change. That might make it hard to detect.
https://clickercounter.org/
https://defineprogramming.com/
Dec 26th 2022
9 months ago
rthrth
Jan 2nd 2023
8 months ago