2010-02-24 01:19:59 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
module Sessions
|
|
|
|
module CommandShellOptions
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(info)
|
|
|
|
|
|
|
|
register_advanced_options(
|
|
|
|
[
|
|
|
|
OptString.new('InitialAutoRunScript', [false, "An initial script to run on session created (before AutoRunScript)", '']),
|
|
|
|
OptString.new('AutoRunScript', [false, "A script to automatically on session creation.", ''])
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_session(session)
|
|
|
|
super
|
|
|
|
|
|
|
|
# Configure input/output to match the payload
|
2010-03-12 21:47:27 +00:00
|
|
|
session.user_input = self.user_input if self.user_input
|
|
|
|
session.user_output = self.user_output if self.user_output
|
2010-02-24 01:19:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|