Class Msf::Module
In: lib/msf/core/module.rb
Parent: Object

The module base class is responsible for providing the common interface that is used to interact with modules at the most basic levels, such as by inspecting a given module‘s attributes (name, dsecription, version, authors, etc) and by managing the module‘s data store.

Methods

Included Modules

Rex::Ui::Subscriber Framework::Offspring

Constants

UpdateableOptions = [ "Name", "Description", "Alias" ]   The list of options that support merging in an information hash.

Attributes

arch  [R]  The array of zero or more architectures.
author  [R]  The array of zero or more authors.
datastore  [R]  The module-specific datastore instance.
file_path  [RW]  The path from which the module was loaded.
job_id  [RW]  The job identifier that this module is running as, if any.
license  [R]  The license under which this module is provided.
options  [R]  The module-specific options.
orig_cls  [RW]  This attribute holds the non-duplicated copy of the module implementation. This attribute is used for reloading purposes so that it can be re-duplicated.
platform  [R]  The array of zero or more platforms.
privileged  [R]  Whether or not this module requires privileged access.
references  [R]  The reference count for the module.
refname  [RW]  The module‘s name that is assigned it it by the framework or derived from the path that the module is loaded from.

Public Class methods

This method allows modules to tell the framework if they are usable on the system that they are being loaded on in a generic fashion. By default, all modules are indicated as being usable. An example of where this is useful is if the module depends on something external to ruby, such as a binary.

Creates an instance of an abstract module using the supplied information hash.

Returns this module‘s ranking.

Returns this module‘s ranking as a string representation.

Class method to figure out what type of module this is

Public Instance methods

Returns the module‘s alias, if it has one. Otherwise, the module‘s name is returned.

Return whether or not the module supports the supplied architecture.

Return a comma separated list of supported architectures, if any.

Return a comma separated list of author for this module.

Returns true if this module is an auxiliary module.

The default communication subsystem for this module. We may need to move this somewhere else.

Returns the hash that describes this module‘s compatibilities.

Returns whether or not this module is compatible with the supplied module.

Returns true if this module is being debugged. The debug flag is set by setting datastore[‘DEBUG’] to 1|true|yes

Return the module‘s description.

Enumerate each architecture.

Enumerate each author.

Returns true if this module is an encoder module.

Returns true if this module is an exploit module.

The path to the file in which the module can be loaded from.

Returns the class reference to the framework

Returns the module‘s framework full reference name. This is the short name that end-users work with (refname) plus the type of module prepended. Ex:

payloads/windows/shell/reverse_tcp

Imports default options into the module‘s datastore, optionally clearing all of the values currently set in the datastore.

Return the module‘s name from the module information hash.

Returns true if this module is a nop module.

Returns the unduplicated class associated with this module.

Returns true if this module is a payload module.

Checks to see if this module is compatible with the supplied platform

Return a comma separated list of supported platforms, if any.

Returns whether or not the module requires or grants high privileges.

Returns the module‘s rank.

Returns the module‘s framework reference name. This is the short name that end-users work with. Ex:

windows/shell/reverse_tcp

Overrides the class’ own datastore with the one supplied. This is used to allow modules to share datastores, such as a payload sharing an exploit module‘s datastore.

Returns the module‘s framework short name. This is a possibly conflicting name used for things like console prompts.

reverse_tcp

Return the module‘s abstract type.

This method ensures that the options associated with this module all have valid values according to each required option in the option container.

Return the module‘s version information.

Protected Instance methods

Removes the supplied options from the module‘s option container and data store.

Checks to see if a derived instance of a given module implements a method beyond the one that is provided by a base class. This is a pretty lame way of doing it, but I couldn‘t find a better one, so meh.

This method initializes the module‘s compatibility hashes by normalizing them into one single hash. As it stands, modules can define compatibility in their supplied info hash through:

  Compat        - direct compat definitions
  PayloadCompat - payload compatibilities
  EncoderCompat - encoder compatibilities
  NopCompat     - nop compatibilities

In the end, the module specific compatibilities are merged as sub-hashes of the primary Compat hash key to make checks more uniform.

Checks and merges the supplied key/value pair in the supplied hash.

Merges options in the info hash in a sane fashion, as some options require special attention.

Merge aliases with an underscore delimiter.

Merges a given key in the info hash with a delimiter.

Register advanced options with a specific owning class.

Register evasion options with a specific owning class.

Register options with a specific owning class.

Sets the modules unsupplied info fields to their default values.

Updates information in the supplied info hash and merges other information. This method is used to override things like Name, Version, and Description without losing the ability to merge architectures, platforms, and options.

[Validate]