From ce3d5d77e4e08aaca077a7672f1e2e777bf48367 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 1 Feb 2018 00:10:32 -0600 Subject: [PATCH] Land #9481, Update native DNS spoofer for Dnsruby --- modules/auxiliary/spoof/dns/native_spoofer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auxiliary/spoof/dns/native_spoofer.rb b/modules/auxiliary/spoof/dns/native_spoofer.rb index 23ea530050..0babd61ddd 100644 --- a/modules/auxiliary/spoof/dns/native_spoofer.rb +++ b/modules/auxiliary/spoof/dns/native_spoofer.rb @@ -100,7 +100,7 @@ class MetasploitModule < Msf::Auxiliary peer = "#{cli.ip_daddr}:" << (cli.is_udp? ? "#{cli.udp_dst}" : "#{cli.tcp_dst}") # Deal with non DNS traffic begin - req = Packet.encode_net(data) + req = Packet.encode_drb(data) rescue => e print_error("Could not decode payload segment of packet from #{peer}, check log") dlog e.backtrace @@ -109,7 +109,7 @@ class MetasploitModule < Msf::Auxiliary answered = [] # Find cached items, remove request from forwarded packet req.question.each do |ques| - cached = service.cache.find(ques.qName, ques.qType.to_s) + cached = service.cache.find(ques.qname, ques.qtype.to_s) if cached.empty? next else @@ -154,7 +154,7 @@ class MetasploitModule < Msf::Auxiliary def sent_info(cli,data) net = Packet.encode_net(data) peer = "#{cli.ip_daddr}:" << (cli.is_udp? ? "#{cli.udp_dst}" : "#{cli.tcp_dst}") - asked = net.question.map(&:qName).join(', ') + asked = net.question.map(&:qname).join(', ') vprint_good("Sent packet with header:\n#{cli.inspect}") vprint_good("Spoofed records for #{asked} to #{peer}") end