Skip to content

Commit 812d7ca

Browse files
author
RageLtMan
committed
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.
1 parent beb4d56 commit 812d7ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/auxiliary/spoof/dns/native_spoofer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def on_dispatch_request(cli,data)
100100
peer = "#{cli.ip_daddr}:" << (cli.is_udp? ? "#{cli.udp_dst}" : "#{cli.tcp_dst}")
101101
# Deal with non DNS traffic
102102
begin
103-
req = Packet.encode_net(data)
103+
req = Packet.encode_drb(data)
104104
rescue => e
105105
print_error("Could not decode payload segment of packet from #{peer}, check log")
106106
dlog e.backtrace
@@ -109,7 +109,7 @@ def on_dispatch_request(cli,data)
109109
answered = []
110110
# Find cached items, remove request from forwarded packet
111111
req.question.each do |ques|
112-
cached = service.cache.find(ques.qName, ques.qType.to_s)
112+
cached = service.cache.find(ques.qname, ques.qtype.to_s)
113113
if cached.empty?
114114
next
115115
else
@@ -154,7 +154,7 @@ def on_send_response(cli,data)
154154
def sent_info(cli,data)
155155
net = Packet.encode_net(data)
156156
peer = "#{cli.ip_daddr}:" << (cli.is_udp? ? "#{cli.udp_dst}" : "#{cli.tcp_dst}")
157-
asked = net.question.map(&:qName).join(', ')
157+
asked = net.question.map(&:qname).join(', ')
158158
vprint_good("Sent packet with header:\n#{cli.inspect}")
159159
vprint_good("Spoofed records for #{asked} to #{peer}")
160160
end

0 commit comments

Comments
 (0)