Clean up some rdoc comments

This adds categories for the various interfaces that meterpreter and
shell sessions implement so they are grouped logically in the docs.
unstable
James Lee 2012-02-28 16:31:03 -07:00
parent 48222b35bc
commit 46fef357f4
2 changed files with 46 additions and 21 deletions

View File

@ -27,6 +27,8 @@ class CommandShell
include Msf::Session::Scriptable
##
# :category: Msf::Session::Scriptable implementors
#
# Executes the supplied script, must be specified as full path.
#
@ -71,6 +73,8 @@ class CommandShell
self.class.type
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# The shell will have been initialized by default.
#
@ -78,6 +82,8 @@ class CommandShell
return true
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Explicitly run a single command, return the output.
#
@ -100,6 +106,8 @@ class CommandShell
buff
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Read from the command shell.
#
@ -161,6 +169,8 @@ class CommandShell
buff
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Writes to the command shell.
#
@ -177,6 +187,8 @@ class CommandShell
end
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Closes the shell.
#
@ -225,6 +237,9 @@ class CommandShell
protected
##
# :category: Msf::Session::Interactive implementors
#
# Override the basic session interaction to use shell_read and
# shell_write instead of operating on rstream directly.
def _interact
@ -236,6 +251,9 @@ protected
end
end
##
# :category: Msf::Session::Interactive implementors
#
def _interact_stream
fds = [rstream.fd, user_input.fd]
while self.interacting

View File

@ -18,10 +18,10 @@ module Sessions
###
class Meterpreter < Rex::Post::Meterpreter::Client
include Msf::Session
#
# The meterpreter session is interactive
#
include Msf::Session
include Msf::Session::Interactive
include Msf::Session::Comm
@ -81,6 +81,11 @@ class Meterpreter < Rex::Post::Meterpreter::Client
self.class.type
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Create a channelized shell process on the target
#
def shell_init
return true if @shell
@ -91,6 +96,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Read from the command shell.
#
@ -116,6 +123,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
end
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Write to the command shell.
#
@ -133,6 +142,11 @@ class Meterpreter < Rex::Post::Meterpreter::Client
len
end
##
# :category: Msf::Session::Provider::SingleCommandShell implementors
#
# Terminate the shell channel
#
def shell_close
@shell.close
@shell = nil
@ -167,11 +181,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
end
##
#
# Msf::Session overrides
#
##
# :category: Msf::Session overrides
#
# Cleans up the meterpreter client session.
#
@ -181,6 +191,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
super
end
##
# :category: Msf::Session overrides
#
# Returns the session description.
#
@ -190,11 +202,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
##
#
# Msf::Session::Scriptable implementors
#
##
# :category: Msf::Session::Scriptable implementors
#
# Runs the meterpreter script in the context of a script container
#
@ -205,11 +213,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
##
#
# Msf::Session::Interactive implementors
#
##
# :category: Msf::Session::Interactive implementors
#
# Initializes the console's I/O handles.
#
@ -222,6 +226,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
super
end
##
# :category: Msf::Session::Interactive implementors
#
# Resets the console's I/O handles.
#
@ -249,6 +255,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
console.queue_cmd(cmd)
end
##
# :category: Msf::Session::Interactive implementors
#
# Explicitly runs a command in the meterpreter console.
#
@ -316,6 +324,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
end
end
rescue ::Interrupt
dlog("Interrupt while loading sysinfo: #{e.class}: #{e}")
raise $!
rescue ::Exception => e
# Log the error but otherwise ignore it so we don't kill the
@ -325,6 +334,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
end
end
##
# :category: Msf::Session::Interactive implementors
#
# Interacts with the meterpreter client at a user interface level.
#
@ -343,11 +354,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
##
#
# Msf::Session::Comm implementors
#
##
# :category: Msf::Session::Comm implementors
#
# Creates a connection based on the supplied parameters and returns it to
# the caller. The connection is created relative to the remote machine on