commit
4cbf4d9301
|
@ -51,8 +51,14 @@ module Enumeration
|
|||
dns.nameservers -= dns.nameservers
|
||||
dns.nameservers = ns_a_records
|
||||
zone = dns.axfr(domain)
|
||||
rescue ResolverArgumentError, Errno::ECONNREFUSED, Errno::ETIMEDOUT, ::NoResponseError, ::Timeout::Error => e
|
||||
|
||||
# Original set of exceptions which were deliberately caught but were missing some
|
||||
# situations. Leaving these in as they may want to be treated differently
|
||||
# to other, maybe more generic, exceptions.
|
||||
rescue ResolverArgumentError, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::ETIMEDOUT, ::NoResponseError, ::Timeout::Error => e
|
||||
print_error("Query #{domain} DNS AXFR - exception: #{e}")
|
||||
rescue => e
|
||||
print_error("Query #{domain} DNS AXFR - unknown exception: #{e}")
|
||||
end
|
||||
next if zone.blank?
|
||||
records << zone
|
||||
|
|
|
@ -65,7 +65,13 @@ class MetasploitModule < Msf::Auxiliary
|
|||
domain = datastore['DOMAIN']
|
||||
is_wildcard = dns_wildcard_enabled?(domain)
|
||||
|
||||
dns_axfr(domain) if datastore['ENUM_AXFR']
|
||||
# All exceptions should be being handled by the library
|
||||
# but catching here as well, just in case.
|
||||
begin
|
||||
dns_axfr(domain) if datastore['ENUM_AXFR']
|
||||
rescue => e
|
||||
print_error("AXFR failed: #{e}")
|
||||
end
|
||||
dns_get_a(domain) if datastore['ENUM_A']
|
||||
dns_get_cname(domain) if datastore['ENUM_CNAME']
|
||||
dns_get_ns(domain) if datastore['ENUM_NS']
|
||||
|
|
Loading…
Reference in New Issue