Fixes for bug #13956

This commit is contained in:
Robin 2020-08-10 16:31:11 +01:00
parent 1663bf3184
commit 92e0522524
2 changed files with 13 additions and 1 deletions

View File

@ -51,8 +51,14 @@ module Enumeration
dns.nameservers -= dns.nameservers
dns.nameservers = ns_a_records
zone = dns.axfr(domain)
# 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::ETIMEDOUT, ::NoResponseError, ::Timeout::Error => e
print_error("Query #{domain} DNS AXFR - exception: #{e}")
rescue => e
print_error("Query #{domain} DNS AXFR - exception: #{e}")
end
next if zone.blank?
records << zone

View File

@ -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']