# -*- coding: binary -*-

require 'msf/core/exploit/cmdstager'

module Msf

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

	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_adodb")]),
			], self.class)
	end

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

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

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

end
