|
| 1 | +DNSMAP README FILE |
| 2 | + |
| 3 | +INTRODUCTION |
| 4 | + |
| 5 | +dnsmap was originally released in back in 2006 and was inspired by the |
| 6 | +fictional story "The Thief No One Saw" by Paul Craig, which can be found |
| 7 | +in the book "Stealing the Network - How to 0wn the Box" |
| 8 | + |
| 9 | +dnsmap is mainly meant to be used by pentesters during the information |
| 10 | +gathering/enumeration phase of infrastructure security assessments. During the |
| 11 | +enumeration stage, the security consultant would typically discover the target |
| 12 | +company's IP netblocks, domain names, phone numbers, etc ... |
| 13 | + |
| 14 | +Subdomain brute-forcing is another technique that should be used in the |
| 15 | +enumeration stage, as it's especially useful when other domain enumeration |
| 16 | +techniques such as zone transfers don't work (I rarely see zone transfers |
| 17 | +being publicly allowed these days by the way). |
| 18 | + |
| 19 | +If you are interested in researching stealth computer intrusion techniques, |
| 20 | +I suggest reading this excellent (and fun) chapter which you can find for |
| 21 | +*free* on the web: |
| 22 | + |
| 23 | +http://www.google.com/search?q=%22The+Thief+No+One+Saw%22+%22Paul+Craig%22 |
| 24 | +http://www.syngress.com/book_catalog/249_STL_NTW/sample.pdf |
| 25 | +http://www.ethicalhacker.net/content/view/45/2/ |
| 26 | + |
| 27 | +I'm happy to say that dnsmap was included in Backtrack 2 and 3 - although the version |
| 28 | +included is now quite dated - and has been reviewed by the community: |
| 29 | + |
| 30 | +http://backtrack.offensive-security.com/index.php?title=Tools |
| 31 | +http://www.linuxhaxor.net/2007/07/14/backtrack-2-information-gathering-all-dnsmap/ |
| 32 | +http://www.darknet.org.uk/2009/03/dnsmap-022-released-subdomain-bruteforcing-tool/ |
| 33 | +http://www.gnucitizen.org/blog/new-version-of-dnsmap-out/ |
| 34 | + |
| 35 | + |
| 36 | +COMPILING |
| 37 | + |
| 38 | +Compiling should be straightforward: |
| 39 | + |
| 40 | +$ make |
| 41 | + |
| 42 | +Or: |
| 43 | + |
| 44 | +$ gcc -Wall dnsmap.c -o dnsmap |
| 45 | + |
| 46 | + |
| 47 | +INSTALLATION |
| 48 | + |
| 49 | +Example of manual installation: |
| 50 | + |
| 51 | +# cp ./dnsmap /usr/local/bin/dnsmap |
| 52 | + |
| 53 | +If you wish to bruteforce several target domains in a bulk fashion, you can use the |
| 54 | +included dnsmap-bulk.sh script. Just copy the script to /usr/local/bin/ so you can |
| 55 | +call it from any location. i.e.: |
| 56 | + |
| 57 | +# cp ./dnsmap-bulk.sh /usr/local/bin/ |
| 58 | + |
| 59 | +And set execute permissions. e.g.: |
| 60 | + |
| 61 | +# chmod ugo+x /usr/local/bin/dnsmap-bulk.sh |
| 62 | + |
| 63 | + |
| 64 | +LIMITATIONS |
| 65 | + |
| 66 | +This tool won't work with target domains which use wildcards. When a domain |
| 67 | +uses wildcards, all bruteforced subdomains will resolve to the same IP address, |
| 68 | +which makes enumerating target servers unfeasible. |
| 69 | + |
| 70 | +dnsmap *does* however inform the user when wildcards have been detected and suggests |
| 71 | +choosing a different target domain. |
| 72 | + |
| 73 | + |
| 74 | +FUN THINGS THAT CAN HAPPEN |
| 75 | + |
| 76 | +1. Finding interesting remote access servers (i.e.: https://extranet.targetdomain.com) |
| 77 | + |
| 78 | +2. Finding badly configured and/or unpatched servers (i.e.: test.targetdomain.com) |
| 79 | + |
| 80 | +3. Finding new domain names which will allow you to map non-obvious/hard-to-find netblocks |
| 81 | + of your target organization (registry lookups - aka whois is your friend) |
| 82 | + |
| 83 | +4. Sometimes you find that some bruteforced subdomains resolve to internal IP addresses |
| 84 | + (RFC 1918). This is great as sometimes they are real up-to-date "A" records which means that |
| 85 | + it *is* possible to enumerate internal servers of a target organization from the Internet |
| 86 | + by only using standard DNS resolving (as oppossed to zone transfers for instance). |
| 87 | + |
| 88 | + |
| 89 | +USAGE |
| 90 | + |
| 91 | +Bruteforcing can be done either with dnsmap's built-in wordlist or a user-supplied wordlist. |
| 92 | +Results can be saved in CSV and human-readable format for further processing. dnsmap does NOT |
| 93 | +require root privileges to be run, and should NOT be run with such privileges for security reasons. |
| 94 | + |
| 95 | +The usage syntax can be obtained by simply running dnsmap without any parameters: |
| 96 | + |
| 97 | +$ ./dnsmap |
| 98 | + |
| 99 | +dnsmap 0.24 - DNS Network Mapper by pagvac (gnucitizen.org) |
| 100 | + |
| 101 | +usage: dnsmap <target-domain> [options] |
| 102 | +options: |
| 103 | +-w <wordlist-file> |
| 104 | +-r <regular-results-file> |
| 105 | +-c <csv-results-file> |
| 106 | +-d <delay-milliseconds> |
| 107 | +e.g.: |
| 108 | +dnsmap target-domain.foo |
| 109 | +dnsmap target-domain.foo -w yourwordlist.txt -r /tmp/domainbf_results.txt |
| 110 | +dnsmap target-fomain.foo -r /tmp/ -d 3000 |
| 111 | +dnsmap target-fomain.foo -r ./domainbf_results.txt |
| 112 | + |
| 113 | +Example of subdomain bruteforcing using dnsmap's built-in word-list: |
| 114 | + |
| 115 | +$ ./dnsmap targetdomain.foo |
| 116 | + |
| 117 | +Example of subdomain bruteforcing using a user-supplied wordlist: |
| 118 | + |
| 119 | +$ ./dnsmap targetdomain.foo -w wordlist.txt |
| 120 | + |
| 121 | +Example of subdomain bruteforcing using the built-in wordlist and saving the results to /tmp/ : |
| 122 | + |
| 123 | +$ ./dnsmap targetdomain.foo -r /tmp/ |
| 124 | + |
| 125 | +Since no filename was provided in the previous example, but rather only a path, dnsmap would create an unique filename which includes the current timestamp. E.g.: /tmp/dnsmap_targetdomain_foo_2009_12_15_234953.txt |
| 126 | + |
| 127 | +Example of subdomain bruteforcing using the built-in wordlist, saving the results to /tmp/, and waiting a random maximum of 3 milliseconds between each request: |
| 128 | + |
| 129 | +$ ./dnsmap targetdomain.foo -r /tmp/ -d 3 |
| 130 | + |
| 131 | +It is recommended to use the -d (delay in milliseconds) option in cases where dnsmap is interfering with your online experience. i.e.: killing your bandwidth |
| 132 | + |
| 133 | +For bruteforcing a list of target domains in a bulk fashion use the bash script provided. e.g.: |
| 134 | + |
| 135 | +$ ./dnsmap-bulk.sh domains.txt /tmp/results/ |
| 136 | + |
| 137 | + |
| 138 | +WORDLISTS |
| 139 | + |
| 140 | +http://packetstormsecurity.org/Crackers/wordlists/dictionaries/ |
| 141 | +http://www.cotse.com/tools/wordlists1.htm |
| 142 | + |
| 143 | + |
| 144 | +OTHER SIMILAR TOOLS - choice is freedom! |
| 145 | + |
| 146 | +WS-DNS-BFX |
| 147 | +http://ws.hackaholic.org/tools/WS-DNS-BFX.tgz |
| 148 | + |
| 149 | +DNSDigger |
| 150 | +http://www.ernw.de/download/dnsdigger.zip |
| 151 | + |
| 152 | +Fierce Domain Scan |
| 153 | +http://ha.ckers.org/fierce/ |
| 154 | + |
| 155 | +Desperate |
| 156 | +http://www.sensepost.com/research_misc.html |
| 157 | + |
| 158 | +DNSenum |
| 159 | +http://dnsenum.googlecode.com/files/dnsenum1.2.tar.gz |
| 160 | + |
| 161 | +ReverseRaider |
| 162 | +http://complemento.sourceforge.net/ |
| 163 | + |
| 164 | + |
| 165 | +-- |
| 166 | +pagvac | GNUCITIZEN.org |
| 167 | +January 2010 |
0 commit comments