add ipv6 support for CHOST

bug/bundler_fix
Brent Cook 2017-06-25 14:57:15 -05:00
parent 269597f994
commit 7bc0dcea42
1 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,11 @@ class MetasploitModule < Msf::Auxiliary
fqdn = "#{datastore['HOSTNAME']}.#{domain}"
opts = {nameserver: datastore['RHOST']}
if datastore['CHOST'] && datastore['CHOST'] != ""
opts[:src_address] = datastore['CHOST']
if Rex::Socket.is_ipv4?(datastore['CHOST'])
opts[:src_address] = datastore['CHOST']
elsif Rex::Socket.is_ipv6?(datastore['CHOST'])
opts[:src_address6] = datastore['CHOST']
end
end
resolver = Dnsruby::Resolver.new(opts)
update = Dnsruby::Update.new(domain)