Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/mdns/query.rb
Views: 11784
##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::MDNS910def initialize(info = {})11super(12update_info(13info,14'Name' => 'mDNS Query',15'Description' => %q(16This module sends mDNS queries, which are really just normal UDP DNS17queries done (usually) over multicast on a different port, 5353.18),19'Author' =>20[21'Jon Hart <jon_hart[at]rapid7.com>'22],23'License' => MSF_LICENSE24)25)26end2728def scanner_prescan(batch)29print_status("Sending mDNS #{query_type_name} #{query_class_name} queries for " \30"#{query_name} to #{batch[0]}->#{batch[-1]} port #{rport} (#{batch.length} hosts)")31@results = {}32end3334def scanner_postscan(_batch)35found = {}36@results.each_pair do |peer, resps|37resps.each do |resp|38found[peer] ||= {}39next if found[peer][resp]40response_info = describe_response(resp)41print_good("#{peer} responded with #{response_info}")42report_service(host: peer, port: rport, proto: "udp", name: "mdns", info: response_info)43found[peer][resp] = true44end45end46end47end484950