Class: Msf::Plugin::Sample::ConsoleCommandDispatcher

Inherits:
Object
  • Object
show all
Includes:
Ui::Console::CommandDispatcher
Defined in:
plugins/sample.rb

Overview

This class implements a sample console command dispatcher.

Instance Attribute Summary

Attributes included from Ui::Console::CommandDispatcher

#driver

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

#shell, #tab_complete_items

Instance Method Summary collapse

Methods included from Ui::Console::CommandDispatcher

#active_module, #active_module=, #active_session, #active_session=, #build_range_array, #docs_dir, #framework, #initialize, #load_config, #log_error, #remove_lines

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

#cmd_help, #cmd_help_help, #cmd_help_tabs, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, included, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #unknown_command, #update_prompt

Instance Method Details

#cmd_sample(*args) ⇒ Object

This method handles the sample command.



39
40
41
# File 'plugins/sample.rb', line 39

def cmd_sample(*args)
  print_line("You passed: #{args.join(' ')}")
end

#commandsObject

Returns the hash of commands supported by this dispatcher.



30
31
32
33
34
# File 'plugins/sample.rb', line 30

def commands
  {
    'sample' => 'A sample command added by the sample plugin'
  }
end

#nameObject

The dispatcher's name.



23
24
25
# File 'plugins/sample.rb', line 23

def name
  'Sample'
end