Files
metasploit-gs/lib/msf/base/sessions/command_shell.rb
T
Matt Miller 6a5870ddcd updated comments to be more uniformed in class definition
git-svn-id: file:///home/svn/incoming/trunk@3004 4d416f70-5f16-0410-b530-b9f4589650da
2005-11-02 16:49:45 +00:00

69 lines
956 B
Ruby

require 'msf/base'
module Msf
module Sessions
###
#
# This class provides basic interaction with a command shell on the remote
# endpoint. This session is initialized with a stream that will be used
# as the pipe for reading and writing the command shell.
#
###
class CommandShell
#
# This interface supports basic interaction.
#
include Msf::Session::Basic
#
# This interface supports interacting with a single command shell.
#
include Msf::Session::Provider::SingleCommandShell
def self.type
"shell"
end
def desc
"Command shell"
end
def type
self.class.type
end
#
# The shell will have been initialized by default
#
def init_shell
return true
end
#
# Read from the command shell
#
def read_shell(length = nil)
return rstream.read(length)
end
#
# Writes to the command shell
#
def write_shell(buf)
rstream.write(buf)
end
#
# Closes the shell
#
def close_shell()
rstream.close
end
end
end
end