Skip to content

Commit 012081e

Browse files
committed
Added support for ANY queries. Silently ignore unsupported queries instead of spamming stdout.
1 parent 03e4ee9 commit 012081e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

modules/auxiliary/spoof/llmnr/llmnr_response.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,27 @@ def dispatch_request(packet, rhost, src_port)
9898
:type => ::Net::DNS::AAAA,
9999
:address => (spoof.ipv6? ? spoof : spoof.ipv4_mapped).to_s
100100
)
101+
when ::Net::DNS::ANY
102+
# For ANY queries, respond with both an A record as well as an AAAA.
103+
dns_pkt.answer << ::Net::DNS::RR::A.new(
104+
:name => name,
105+
:ttl => datastore['TTL'],
106+
:cls => ::Net::DNS::IN,
107+
:type => ::Net::DNS::A,
108+
:address => spoof.to_s
109+
)
110+
dns_pkt.answer << ::Net::DNS::RR::AAAA.new(
111+
:name => name,
112+
:ttl => datastore['TTL'],
113+
:cls => ::Net::DNS::IN,
114+
:type => ::Net::DNS::AAAA,
115+
:address => (spoof.ipv6? ? spoof : spoof.ipv4_mapped).to_s
116+
)
117+
when ::Net::DNS::PTR
118+
# Sometimes PTR queries are received. We will silently ignore them.
119+
next
101120
else
102-
print_warning("#{rhost.to_s.ljust 16} llmnr - Unknown RR type, this shouldn't happen. Skipping")
121+
print_warning("#{rhost.to_s.ljust 16} llmnr - Unknown RR type (#{question.qType.to_i}), this shouldn't happen. Skipping")
103122
next
104123
end
105124
end

0 commit comments

Comments
 (0)