Path: blob/master/modules/auxiliary/scanner/llmnr/query.rb
19664 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Auxiliary::UDPScanner8include Msf::Auxiliary::LLMNR910def initialize(info = {})11super(12update_info(13info,14'Name' => 'LLMNR Query',15'Description' => %q{16This module sends LLMNR queries, which are really just normal UDP DNS17queries done (usually) over multicast on a different port, 5355.18Targets other than the default RHOSTS' 224.0.0.252 should not respond19but may anyway.20},21'Author' => [22'Jon Hart <jon_hart[at]rapid7.com>'23],24'License' => MSF_LICENSE,25'Notes' => {26'Reliability' => UNKNOWN_RELIABILITY,27'Stability' => UNKNOWN_STABILITY,28'SideEffects' => UNKNOWN_SIDE_EFFECTS29}30)31)32end3334def scanner_prescan(batch)35print_status("Sending LLMNR #{query_type_name}/#{query_class_name} queries for #{query_name} to #{batch[0]}->#{batch[-1]} port #{rport} (#{batch.length} hosts)")36@results = {}37end3839def scanner_postscan(_batch)40found = {}41@results.each_pair do |peer, resps|42resps.each do |resp|43found[peer] ||= {}44next if found[peer][resp]4546response_info = describe_response(resp)47print_good("#{peer} responded with #{response_info}")48report_service(host: peer, port: rport, proto: "udp", name: "llmnr", info: response_info)49found[peer][resp] = true50end51end52end53end545556