Today I will be reviewing Dnsmap from the Backtrack 4 Distribution. Dnsmap was originally released back in 2006 and has become a standard tool included is every backtrack release. There are other tools which preform the same tasks but I am a firm believer that a pentester/hacker should have the choice of as many tools as possible. My only small issue with this tool is speed, meaning it is not multi threaded however the author says in the readme.txt that he is addressing that issue. Dnsmap is mainly meant to be used by pentesters during the information gathering/enumeration phase of infrastructure security assessments. During the enumeration stage, the security consultant would typically discover the target
company’s IP netblocks, domain names, phone numbers, etc …

Subdomain brute-forcing is another technique that should be used in the enumeration stage, as it’s especially useful when other domain enumeration techniques such as zone transfers don’t work.

Here are some things that Dnsmap can be used for:

1. Finding interesting remote access servers (e.g.:

2. Finding badly configured and/or unpatched servers (e.g.:

3. Finding new domain names which will allow you to map non-obvious/hard-to-find netblocks

4. Sometimes you find that some bruteforced subdomains resolve to internal IP addresses
(RFC 1918). This is great as sometimes they are real up-to-date “A” records which means
that it *is* possible to enumerate internal servers of a target organization from the
Internet by only using standard DNS resolving (as oppossed to zone transfers for instance).

5. Discover embedded devices configured using Dynamic DNS services (e.g.:
This method is an alternative to finding devices via Google hacking techniques

Bruteforcing can be done either with dnsmap’s built-in wordlist or a user-supplied wordlist. Results can be saved in CSV and human-readable format for further processing. dnsmap does NOT require root privileges to be run.

Most of the preceding information came from the README.txt that the author supplied with the tool, I didn’t think there was any reason to rewrite it all and reinvent the wheel. I will just be showing you a sample session of how I would use Dnsmap in a penetration test.

First lets check out the usage:

root@666:/pentest/enumeration/dns/dnsmap# ./dnsmap
dnsmap 0.30 - DNS Network Mapper by pagvac (

usage: dnsmap <target-domain> [options]
-w <wordlist-file>
-r <regular-results-file>
-c <csv-results-file>
-d <delay-millisecs>
-i <ips-to-ignore> (useful if you're obtaining false positives)

dnsmap -w yourwordlist.txt -r /tmp/domainbf_results.txt
dnsmap -r /tmp/ -d 3000
dnsmap -r ./domainbf_results.txt

Pretty simple tool so lets show a example session:

root@666:/pentest/enumeration/dns/dnsmap# ./dnsmap -r results.txt
dnsmap 0.30 - DNS Network Mapper by pagvac (

[+] searching (sub)domains for using built-in wordlist
[+] using maximum random delay of 10 millisecond(s) between requests
IP address #1:
IP address #2:
IP address #1:
IP address #2:
IP address #1:
IP address #2:
IP address #1:
IP address #2:
IP address #1:
IP address #1:
IP address #2:
IP address #1:
IP address #2:

What we are doing here is attempting to bruteforce all of the subdomains of and saving them to a file called results.txt. I have truncated the output since its very long.

If you have a custom wordlist of subdomains you can use that as well simply by specifying the -w argument and then the path to the wordlist.

Once Dnsmap has completed its run we can look in the file and see all the subdomains and IPs in the list:

root@666:/pentest/enumeration/dns/dnsmap# head results.txt
IP address #1:
IP address #2:
IP address #1:
IP address #2:
IP address #1:

Now, for you this may be a good format but what I want is a list of IPs to add to my list of possible targets when I move on to a more active scanning phase of the pentest.

So lets apply a little bashfoo to clean up this list:

root@666:/pentest/enumeration/dns/dnsmap# cat results.txt | sed '/^$/d' | sed '/' | cut -d ':' -f 2 | sort -u | sed '$d' > ips.txt

And now we have a nice tidy list of IP addresses for the next phase of our attack:

root@666:/pentest/enumeration/dns/dnsmap# cat ips.txt

There is also a script to bruteforce a list of domains if you are looking at a very large attack surface:

usage: <domains-file> [results-path]
e.g.: domains.txt domains.txt /tmp/

I hope this review of dnsmap is helpful and I would like to give a big thanks to GNUCitizen for Dnsmap and all the rest of the stuff they do for the opensource community.

List Price: $49.99 USD
New From: $49.97 USD In Stock
Used from: $0.45 USD In Stock

Penetration Tester's Open Source Toolkit, Vol. 2 (Paperback)

By (author): Jeremy Faircloth, Chris Hurley, Jesse Varsalone

List Price: $61.95 USD
New From: $44.46 USD In Stock
Used from: $2.75 USD In Stock

Tags: , , , , , , , ,
4 Responses to “Backtrack 4: Information Gathering: DNS: Dnsmap – Subdomain brute-forcing”
  1. Magic-NET says:

    There are two more ways to find the subdomains. AXFR and search engine results.

    You can find subdomains using this page:

    If zone transfer is not possible, this tool will use search engine results.


    purehate Reply:

    Thanks for the insight. There are lots of ways to find sub domains but this series of articles is meant to focus on the tools in Backtrack-Linux.


  2. Ryan says:

    I think you are referring to It’s a script that uses google search results to find sub domains passively. Here is a tutorial on how to install and use it:
    If you are trying to find sub domains, use dnsmap and to get the most results.


Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.