Skip to content

Commit c137245

Browse files
committed
Land rapid7#8326, support LLMNR ANY responses
2 parents e64fcfc + cf74cb8 commit c137245

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
@@ -97,8 +97,27 @@ def dispatch_request(packet, rhost, src_port)
9797
:type => ::Net::DNS::AAAA,
9898
:address => (spoof.ipv6? ? spoof : spoof.ipv4_mapped).to_s
9999
)
100+
when ::Net::DNS::ANY
101+
# For ANY queries, respond with both an A record as well as an AAAA.
102+
dns_pkt.answer << ::Net::DNS::RR::A.new(
103+
:name => name,
104+
:ttl => datastore['TTL'],
105+
:cls => ::Net::DNS::IN,
106+
:type => ::Net::DNS::A,
107+
:address => spoof.to_s
108+
)
109+
dns_pkt.answer << ::Net::DNS::RR::AAAA.new(
110+
:name => name,
111+
:ttl => datastore['TTL'],
112+
:cls => ::Net::DNS::IN,
113+
:type => ::Net::DNS::AAAA,
114+
:address => (spoof.ipv6? ? spoof : spoof.ipv4_mapped).to_s
115+
)
116+
when ::Net::DNS::PTR
117+
# Sometimes PTR queries are received. We will silently ignore them.
118+
next
100119
else
101-
print_warning("#{rhost.to_s.ljust 16} llmnr - Unknown RR type, this shouldn't happen. Skipping")
120+
print_warning("#{rhost.to_s.ljust 16} llmnr - Unknown RR type (#{question.qType.to_i}), this shouldn't happen. Skipping")
102121
next
103122
end
104123
end

0 commit comments

Comments
 (0)