Path: blob/master/modules/auxiliary/scanner/discovery/empty_udp.rb
19567 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::UDPScanner89def initialize10super(11'Name' => 'UDP Empty Prober',12'Description' => 'Detect UDP services that reply to empty probes.',13'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',14'License' => MSF_LICENSE,15'Notes' => {16'Stability' => [CRASH_SAFE],17'SideEffects' => [],18'Reliability' => []19}20)21register_options([22OptString.new('PORTS', [true, 'Ports to probe', '1-1024,1194,2000,2049,4353,5060,5061,5351,8443'])23])24end2526def setup27super28@ports = Rex::Socket.portspec_crack(datastore['PORTS'])29raise Msf::OptionValidateError, ['PORTS'] if @ports.empty?30end3132def scanner_prescan(batch)33print_status("Sending #{@ports.length} empty probes to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")34end3536def scan_host(ip)37@ports.each do |port|38scanner_send('', ip, port)39end40end4142def scanner_process(data, shost, sport)43print_good("Received #{data.inspect} from #{shost}:#{sport}/udp")44report_service(host: shost, port: sport, proto: 'udp', info: data.inspect)45end46end474849