From 10cf618c19f68db3830cc640e6c8fb70d88a32e2 Mon Sep 17 00:00:00 2001 From: Carlos Perez Date: Wed, 11 Nov 2009 14:14:55 +0000 Subject: [PATCH] Fix AXFR error handling git-svn-id: file:///home/svn/framework3/trunk@7466 4d416f70-5f16-0410-b530-b9f4589650da --- modules/auxiliary/gather/dns_enum.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/auxiliary/gather/dns_enum.rb b/modules/auxiliary/gather/dns_enum.rb index dacac5eb5f..752f17618d 100644 --- a/modules/auxiliary/gather/dns_enum.rb +++ b/modules/auxiliary/gather/dns_enum.rb @@ -307,12 +307,13 @@ class Metasploit3 < Msf::Auxiliary if not nssrv.nil? @res.nameserver=(nssrv) end - #@res.tcp_timeout=15 + @res.tcp_timeout=15 query = @res.query(target, "NS") if (query.answer.length != 0) (query.answer.select { |i| i.class == Net::DNS::RR::NS}).each do |nsrcd| print_status("Testing Nameserver: #{nsrcd.nsdname}") nssrvquery = @res.query(nsrcd.nsdname, "A") + begin nssrvip = nssrvquery.answer[0].address.to_s @res.nameserver=(nssrvip) zone = [] @@ -397,7 +398,11 @@ class Metasploit3 < Msf::Auxiliary else print_status("Zone Transfer Failed") end + rescue + print_status("Zone Transfer Failed") end + end + else print_error("Could not resolve domain #{target}") end