added timeout options and rescue timeout

bug/bundler_fix
zeknox 2013-12-16 20:00:13 -06:00
parent fe34d0e36e
commit 2eee34babf
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class Metasploit3 < Msf::Auxiliary
register_advanced_options([
OptBool.new('TCP_DNS', [false, "Run queries over TCP", false]),
OptInt.new('DNS_TIMEOUT', [true, "DNS Timeout in seconds", 5])
], self.class)
end
@ -44,6 +45,7 @@ class Metasploit3 < Msf::Auxiliary
# dns request with recursive disabled
use_tcp = datastore['TCP_DNS']
res = Net::DNS::Resolver.new(:nameservers => "#{datastore['NS']}", :recursive => false, :use_tcp => use_tcp)
use_tcp ? res.tcp_timeout = datastore['DNS_TIMEOUT'] : res.udp_timeout = datastore['DNS_TIMEOUT']
# query dns
begin
@ -51,6 +53,9 @@ class Metasploit3 < Msf::Auxiliary
rescue ResolverArgumentError
print_error("Invalid domain: #{domain}")
return
rescue NoResponseError
print_error("DNS Timeout Issue: #{domain}")
return
end
# found or not found