first pass at better output and report_service
parent
cba3650488
commit
3d04d53e3a
|
@ -65,5 +65,15 @@ module Msf
|
|||
def query_type_num
|
||||
Net::DNS::RR::Types.new(query_type).to_i
|
||||
end
|
||||
|
||||
def describe_response(response)
|
||||
decoded = Resolv::DNS::Message.decode(response)
|
||||
answers = decoded.answer.map(&:to_s)
|
||||
"#{answers.size} answers: #{answers.join(',')}"
|
||||
end
|
||||
|
||||
def request_info
|
||||
"#{query_name} #{query_class}/#{query_type}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,8 +38,9 @@ class Metasploit3 < Msf::Auxiliary
|
|||
def scanner_postscan(_batch)
|
||||
@results.each_pair do |peer, resps|
|
||||
resps.each do |resp|
|
||||
print_good("#{peer} responded with #{Resolv::DNS::Message.decode(resp).inspect}")
|
||||
report_service(host: peer, port: rport, proto: "udp", name: "llmnr")
|
||||
response_info = describe_response(resp)
|
||||
print_good("#{peer} responded with #{response_info}")
|
||||
report_service(host: peer, port: rport, proto: "udp", name: "llmnr", info: "#{request_info} -> #{response_info}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,9 +37,9 @@ class Metasploit3 < Msf::Auxiliary
|
|||
def scanner_postscan(_batch)
|
||||
@results.each_pair do |peer, resps|
|
||||
resps.each do |resp|
|
||||
resp_message = Resolv::DNS::Message.decode(resp)
|
||||
print_good("#{peer} responded with #{resp_message.inspect}")
|
||||
report_service(host: peer, port: rport, proto: "udp", name: "mdns")
|
||||
response_info = describe_response(resp)
|
||||
print_good("#{peer} responded with #{response_info}")
|
||||
report_service(host: peer, port: rport, proto: "udp", name: "mdns", info: "#{request_info} -> #{response_info}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue