今天无意中发现了dnsenum这个工具,在网上搜了下关于dnsenum的介绍和安装使用方法,资料不是很全,但还好这个工具也算简单,网上也都有源码,可以自行下载下来阅读阅读。本人好奇在本机(ubuntu13.04)安装试了试。
dnsenum 是一款非常强大的域名信息收集工具,它是由参与backtrack开发项目的程序员所设计,设计者名叫Fillp (barbsie) Waeythens ,该名开发者是一个精通web渗透测试的安全人员,并对DNS信息收集有着非常丰富的经验。
dnsenum的目的是尽可能收集一个域的信息,它能够通过谷歌或者字典文件猜测可能存在的域名,以及对一个网段进行反向查询。它可以查询网站的主机地址信息、域名服务器、mx record(函件交换记录),在域名服务器上执行axfr请求,通过谷歌脚本得到扩展域名信息(google hacking),提取自域名并查询,计算C类地址并执行whois查询,执行反向查询,把地址段写入文件。
dnsenum是一个perl脚本,脚本文件可以在 http://code.google.com/p/dnsenum/downloads/detail?name=dnsenum.pl&can=2&q= 获取到,脚本源码在 http://code.google.com/p/dnsenum/source/browse/trunk/dnsenum.pl
下载下来是一个叫dnsenum.pl的perl脚本,如果本机安装了perl的话(ubuntu默认安装),直接就可以执行,但是ubuntu在执行的时候会有问题,具体提示向下面:
root@xiong:/xiong# ./dnsenum.pl www.baidu.com
Can't locate String/Random.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./dnsenum.pl line 63.
BEGIN failed--compilation aborted at ./dnsenum.pl line 63.
这是由于在ubuntu 下由于缺少一些perl模块,所以会报错,解决办法:安装缺少的perl模块,操作如下:
sudo perl -MCPAN -e shell
根据提示选择yes下一步,然后出现如下cpan[1]> 提示,
cpan[1]> install Net::IP
cpan[2]> install Net::DNS
cpan[3]> install Net::Netmask
cpan[4]> install XML::Writer
cpan[5]> install String::Random
注:本机运行时缺少哪个模块安装哪个模块就行。
Usage: dnsenum.pl [Options] <domain>
[Options]:
Note: the brute force -f switch is obligatory.
GENERAL OPTIONS:
--dnsserver <server>
Use this DNS server for A, NS and MX queries.
--enum Shortcut option equivalent to --threads 5 -s 15 -w.
-h, --help Print this help message.
--noreverse Skip the reverse lookup operations.
--private Show and save private ips at the end of the file domain_ips.txt.
--subfile <file> Write all valid subdomains to this file.
-t, --timeout <value> The tcp and udp timeout values in seconds (default: 10s).
--threads <value> The number of threads that will perform different queries.
-v, --verbose Be verbose: show all the progress and all the error messages.
GOOGLE SCRAPING OPTIONS:
-p, --pages <value> The number of google search pages to process when scraping names,
the default is 5 pages, the -s switch must be specified.
-s, --scrap <value> The maximum number of subdomains that will be scraped from Google (default 15).
BRUTE FORCE OPTIONS:
-f, --file <file> Read subdomains from this file to perform brute force.
-u, --update <a|g|r|z>
Update the file specified with the -f switch with valid subdomains.
a (all) Update using all results.
g Update using only google scraping results.
r Update using only reverse lookup results.
z Update using only zonetransfer results.
-r, --recursion Recursion on subdomains, brute force all discovred subdomains that have an NS record.
WHOIS NETRANGE OPTIONS:
-d, --delay <value> The maximum value of seconds to wait between whois queries, the value is defined randomly, default: 3s.
-w, --whois Perform the whois queries on c class network ranges.
**Warning**: this can generate very large netranges and it will take lot of time to performe reverse lookups.
REVERSE LOOKUP OPTIONS:
-e, --exclude <regexp>
Exclude PTR records that match the regexp expression from reverse lookup results, useful on invalid hostnames.
OUTPUT OPTIONS:
-o --output <file> Output in XML format. Can be imported in MagicTree (www.gremwell.com)
#./dnsenum.pl baidu.com 或指定DNS服务器,# ./dnsenum.pl -dnsserver 8.8.8.8 www.baidu.com
dnsenum.pl VERSION:1.2.3
----- www.baidu.com -----
Host's addresses:
__________________
www.a.shifen.com. 286 IN A 220.181.112.244
www.a.shifen.com. 286 IN A 220.181.111.188
Name Servers:
______________
Error: can't continue no NS record for www.baidu.com
正常应该有NS MX A记录等信息,但是我这不知道为什么没有,下面是从网上摘的别人的结果