module
Java 7 Applet Remote Code Execution
Disclosed | Created |
---|---|
2012-08-26 | 2018-05-30 |
Disclosed
2012-08-26
Created
2018-05-30
Description
The exploit takes advantage of two issues in JDK 7: The ClassFinder and
MethodFinder.findMethod(). Both were newly introduced in JDK 7. ClassFinder is a
replacement for classForName back in JDK 6. It allows untrusted code to obtain a
reference and have access to a restricted package in JDK 7, which can be used to
abuse sun.awt.SunToolkit (a restricted package). With sun.awt.SunToolkit, we can
actually invoke getField() by abusing findMethod() in Statement.invokeInternal()
(but getField() must be public, and that's not always the case in JDK 6) in order
to access Statement.acc's private field, modify AccessControlContext, and then
disable Security Manager. Once Security Manager is disabled, we can execute
arbitrary Java code.
Our exploit has been tested successfully against multiple platforms, including:
IE, Firefox, Safari, Chrome; Windows, Ubuntu, OS X, Solaris, etc.
MethodFinder.findMethod(). Both were newly introduced in JDK 7. ClassFinder is a
replacement for classForName back in JDK 6. It allows untrusted code to obtain a
reference and have access to a restricted package in JDK 7, which can be used to
abuse sun.awt.SunToolkit (a restricted package). With sun.awt.SunToolkit, we can
actually invoke getField() by abusing findMethod() in Statement.invokeInternal()
(but getField() must be public, and that's not always the case in JDK 6) in order
to access Statement.acc's private field, modify AccessControlContext, and then
disable Security Manager. Once Security Manager is disabled, we can execute
arbitrary Java code.
Our exploit has been tested successfully against multiple platforms, including:
IE, Firefox, Safari, Chrome; Windows, Ubuntu, OS X, Solaris, etc.
Authors
Adam Gowdiak
James Forshaw
jduck jduck@metasploit.com
sinn3r sinn3r@metasploit.com
juan vazquez juan.vazquez@metasploit.com
James Forshaw
jduck jduck@metasploit.com
sinn3r sinn3r@metasploit.com
juan vazquez juan.vazquez@metasploit.com
Platform
Java,Linux,Windows
References
Module Options
To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:

NEW
Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.