Files
metasploit-gs/lib/msf/base/sessions/command_shell_options.rb
T
Joshua Drake 7a37934a01 process autorun scripts for telnet_login and ssh_login
1. create session.process_autoruns in Msf::Sessions::CommandShell
2. call process_autoruns from within the handler on_session code
4. set user_input and user_output in sessions base set_from_exploit method
5. remove on_session from Msf::Sessions::CommandShellOptions
6. include CommandShellOptions into telnet_login and ssh_login
7. call sess.process_autoruns from telnet_login and ssh_login
8. celebrate (while crossing fingers of course)!

git-svn-id: file:///home/svn/framework3/trunk@8692 4d416f70-5f16-0410-b530-b9f4589650da
2010-03-02 18:07:50 +00:00

38 lines
832 B
Ruby

##
# $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
session.user_input = self.user_input
session.user_output = self.user_output
end
end
end
end