first pass at better output and report_service

bug/bundler_fix
Jon Hart 2015-09-02 10:31:46 -07:00
parent cba3650488
commit 3d04d53e3a
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
3 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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