您的位置:首页 > 其它

dnsenum 域名信息收集工具

2014-07-14 14:57 190 查看

1、背景

      今天无意中发现了dnsenum这个工具,在网上搜了下关于dnsenum的介绍和安装使用方法,资料不是很全,但还好这个工具也算简单,网上也都有源码,可以自行下载下来阅读阅读。本人好奇在本机(ubuntu13.04)安装试了试。

2、dnsenum是什么?

    dnsenum 是一款非常强大的域名信息收集工具,它是由参与backtrack开发项目的程序员所设计,设计者名叫Fillp (barbsie) Waeythens ,该名开发者是一个精通web渗透测试的安全人员,并对DNS信息收集有着非常丰富的经验。

    dnsenum的目的是尽可能收集一个域的信息,它能够通过谷歌或者字典文件猜测可能存在的域名,以及对一个网段进行反向查询。它可以查询网站的主机地址信息、域名服务器、mx record(函件交换记录),在域名服务器上执行axfr请求,通过谷歌脚本得到扩展域名信息(google hacking),提取自域名并查询,计算C类地址并执行whois查询,执行反向查询,把地址段写入文件。

3、dnsenum获取&运行

    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

注:本机运行时缺少哪个模块安装哪个模块就行。

4、dnsenum的命令参数

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)

5、dnsenum使用举例

#./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记录等信息,但是我这不知道为什么没有,下面是从网上摘的别人的结果

root@root:/pentest/enumeration/dns/dnsenum# ./dnsenum.pl baidu.com  
dnsenum.pl VERSION:1.2.2  
  
-----   baidu.com   -----  
  
  
Host's addresses:  
__________________  
  
baidu.com                                149      IN    A        220.181.111.85  
baidu.com                                149      IN    A        220.181.111.86  
baidu.com                                149      IN    A        123.125.114.144  
  
  
Name Servers:  
______________  
  
ns4.baidu.com                            72162    IN    A        220.181.38.10  
ns2.baidu.com                            73314    IN    A        61.135.165.235  
dns.baidu.com                            72110    IN    A        202.108.22.220  
ns3.baidu.com                            72256    IN    A        220.181.37.10  
  
  
Mail (MX) Servers:  
___________________  
  
jpmx.baidu.com                           6270     IN    A        61.208.132.13  
mx50.baidu.com                           292      IN    A        220.181.50.208  
mx1.baidu.com                            300      IN    A        61.135.163.61  
  
  
Trying Zone Transfers and getting Bind Versions:  
_________________________________________________  
  
  
Trying Zone Transfer for baidu.com on ns4.baidu.com ...   
AXFR record query failed: NOERROR  
  
ns4.baidu.com Bind Version:     baidu dns  
  
Trying Zone Transfer for baidu.com on ns2.baidu.com ...   
AXFR record query failed: NOERROR  
  
ns2.baidu.com Bind Version:     baidu dns  
  
Trying Zone Transfer for baidu.com on dns.baidu.com ...   
AXFR record query failed: NOERROR  
  
dns.baidu.com Bind Version:     baidu dns  
  
Trying Zone Transfer for baidu.com on ns3.baidu.com ...   
AXFR record query failed: NOERROR  
  
ns3.baidu.com Bind Version:     baidu dns  
 Wildcards detected, all subdomains will point to the same IP address, bye.  
root@root:/pentest/enumeration/dns/dnsenum#  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  DNS