Module: Rex::Post::Meterpreter::Ui::Console::CommandDispatcher

Includes:
Ui::Text::DispatcherShell::CommandDispatcher
Included in:
Core, Espia, Incognito, NetworkPug, Priv, Priv::Elevate, Priv::Passwd, Priv::Timestomp, Sniffer, Stdapi, Stdapi::Fs, Stdapi::Net, Stdapi::Sys, Stdapi::Ui, Stdapi::Webcam
Defined in:
lib/rex/post/meterpreter/ui/console/command_dispatcher.rb

Overview

Base class for all command dispatchers within the meterpreter console user interface.

Defined Under Namespace

Classes: Core, Espia, Incognito, NetworkPug, Priv, Sniffer, Stdapi

Constant Summary collapse

@@file_hash =

The hash of file names to class names after a module has already been loaded once on the client side.

{}

Instance Attribute Summary

Attributes included from Ui::Text::DispatcherShell::CommandDispatcher

#shell, #tab_complete_items

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Ui::Text::DispatcherShell::CommandDispatcher

#cmd_help, #cmd_help_tabs, #commands, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #tab_complete_filenames, #update_prompt

Class Method Details

.check_hash(name) ⇒ Object

Checks the file name to hash association to see if the module being requested has already been loaded once.



28
29
30
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher.rb', line 28

def self.check_hash(name)
	@@file_hash[name]
end

.set_hash(name, klass) ⇒ Object

Sets the file path to class name association for future reference.



35
36
37
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher.rb', line 35

def self.set_hash(name, klass)
	@@file_hash[name] = klass
end

Instance Method Details

#clientObject

Returns the meterpreter client context.



42
43
44
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher.rb', line 42

def client
	shell.client
end

#log_error(msg) ⇒ Object

Log that an error occurred.



49
50
51
52
53
54
55
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher.rb', line 49

def log_error(msg)
	print_error(msg)

	elog(msg, 'meterpreter')

	dlog("Call stack:\n#{$@.join("\n")}", 'meterpreter')
end