##
# $Id: cmdstager_vbs.rb 9375 2010-05-26 22:39:56Z jduck $
##

require 'msf/core/exploit/cmdstager'

module Msf

###
#
# This mixin provides an interface for staging cmd to arbitrary payloads
#
###
module Exploit::CmdStagerVBS

	include Msf::Exploit::CmdStager

	def initialize(info = {})
		super

		register_advanced_options(
			[
				OptString.new( 'DECODERSTUB',  [ true, 'The VBS base64 file decoder stub to use.',
					File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64")]),
			], self.class)
	end

	def create_stager(exe)
		Rex::Exploitation::CmdStagerVBS.new(exe)
	end

	def execute_cmdstager(opts = {})
		opts.merge!({ :decoder => datastore['DECODERSTUB'] })
		super
	end

end

end
