Skip to content

Commit 7bc0dce

Browse files
author
Brent Cook
committed
add ipv6 support for CHOST
1 parent 269597f commit 7bc0dce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/auxiliary/admin/dns/dyn_dns_update.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ def record_action(type, type_enum, value, action)
4848
fqdn = "#{datastore['HOSTNAME']}.#{domain}"
4949
opts = {nameserver: datastore['RHOST']}
5050
if datastore['CHOST'] && datastore['CHOST'] != ""
51-
opts[:src_address] = datastore['CHOST']
51+
if Rex::Socket.is_ipv4?(datastore['CHOST'])
52+
opts[:src_address] = datastore['CHOST']
53+
elsif Rex::Socket.is_ipv6?(datastore['CHOST'])
54+
opts[:src_address6] = datastore['CHOST']
55+
end
5256
end
5357
resolver = Dnsruby::Resolver.new(opts)
5458
update = Dnsruby::Update.new(domain)

0 commit comments

Comments
 (0)