dnsenum 域名信息收集工具

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

  1. root@root:/pentest/enumeration/dns/dnsenum# ./dnsenum.pl baidu.com  
  2. dnsenum.pl VERSION:1.2.2  
  3.   
  4. -----   baidu.com   -----  
  5.   
  6.   
  7. Host's addresses:  
  8. __________________  
  9.   
  10. baidu.com                                149      IN    A        220.181.111.85  
  11. baidu.com                                149      IN    A        220.181.111.86  
  12. baidu.com                                149      IN    A        123.125.114.144  
  13.   
  14.   
  15. Name Servers:  
  16. ______________  
  17.   
  18. ns4.baidu.com                            72162    IN    A        220.181.38.10  
  19. ns2.baidu.com                            73314    IN    A        61.135.165.235  
  20. dns.baidu.com                            72110    IN    A        202.108.22.220  
  21. ns3.baidu.com                            72256    IN    A        220.181.37.10  
  22.   
  23.   
  24. Mail (MX) Servers:  
  25. ___________________  
  26.   
  27. jpmx.baidu.com                           6270     IN    A        61.208.132.13  
  28. mx50.baidu.com                           292      IN    A        220.181.50.208  
  29. mx1.baidu.com                            300      IN    A        61.135.163.61  
  30.   
  31.   
  32. Trying Zone Transfers and getting Bind Versions:  
  33. _________________________________________________  
  34.   
  35.   
  36. Trying Zone Transfer for baidu.com on ns4.baidu.com ...   
  37. AXFR record query failed: NOERROR  
  38.   
  39. ns4.baidu.com Bind Version:     baidu dns  
  40.   
  41. Trying Zone Transfer for baidu.com on ns2.baidu.com ...   
  42. AXFR record query failed: NOERROR  
  43.   
  44. ns2.baidu.com Bind Version:     baidu dns  
  45.   
  46. Trying Zone Transfer for baidu.com on dns.baidu.com ...   
  47. AXFR record query failed: NOERROR  
  48.   
  49. dns.baidu.com Bind Version:     baidu dns  
  50.   
  51. Trying Zone Transfer for baidu.com on ns3.baidu.com ...   
  52. AXFR record query failed: NOERROR  
  53.   
  54. ns3.baidu.com Bind Version:     baidu dns  
  55.  Wildcards detected, all subdomains will point to the same IP address, bye.  
  56. root@root:/pentest/enumeration/dns/dnsenum#  

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值