Class: Msf::Plugin::Alias

Inherits:
Msf::Plugin show all
Defined in:
plugins/alias.rb

Defined Under Namespace

Classes: AliasCommandDispatcher

Instance Attribute Summary

Attributes inherited from Msf::Plugin

#opts

Attributes included from Framework::Offspring

#framework

Instance Method Summary collapse

Methods inherited from Msf::Plugin

#add_console_dispatcher, create, #flush, #input, #output, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #remove_console_dispatcher

Constructor Details

#initialize(framework, opts) ⇒ Alias

The constructor is called when an instance of the plugin is created. The framework instance that the plugin is being associated with is passed in the framework parameter. Plugins should call the parent constructor when inheriting from Msf::Plugin to ensure that the framework attribute on their instance gets set.


303
304
305
306
307
308
# File 'plugins/alias.rb', line 303

def initialize(framework, opts)
  super

  ## Register the commands above
  add_console_dispatcher(AliasCommandDispatcher)
end

Instance Method Details

#cleanupObject

The cleanup routine for plugins gives them a chance to undo any actions they may have done to the framework. For instance, if a console dispatcher was added, then it should be removed in the cleanup routine.


316
317
318
319
320
321
322
323
# File 'plugins/alias.rb', line 316

def cleanup
  # If we had previously registered a console dispatcher with the console,
  # deregister it now.
  remove_console_dispatcher('Alias')

  # we don't need to remove class methods we added because they were added to
  # AliasCommandDispatcher class
end

#descObject

This method returns a brief description of the plugin. It should be no more than 60 characters, but there are no hard limits.


336
337
338
# File 'plugins/alias.rb', line 336

def desc
  "Adds the ability to alias console commands"
end

#nameObject

This method returns a short, friendly name for the plugin.


328
329
330
# File 'plugins/alias.rb', line 328

def name
  "alias"
end