From 812d7ca739574b0ea372f086f8405cb0ca582f85 Mon Sep 17 00:00:00 2001 From: RageLtMan Date: Wed, 31 Jan 2018 23:44:51 -0500 Subject: [PATCH] Update native DNS spoofer for Dnsruby Fix methods relating to answer/question data structures which were set up for Net::DNS objects in the original implementation utilizing uppercase letters in the exact same method names. Testing: None yet, completely forgot i even wrote this module till i saw it in my merge conflicts after upstream merged the PR. --- 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