Class Msf::PayloadSet
In: lib/msf/core/payload_set.rb
Parent: ModuleSet

This class is a special case of the generic module set class because payloads are generated in terms of combinations between various components, such as a stager and a stage. As such, the payload set needs to be built on the fly and cannot be simply matched one-to-one with a payload module. Yeah, the term module is kind of overloaded here, but eat it!

Methods

Attributes

singles  [R]  The list of singles that have been loaded.
sizes  [R]  The sizes of all the built payloads thus far.
stages  [R]  The list of stages that have been loaded.

Public Class methods

Creates an instance of a payload set which is just a specialized module set class that has custom handling for payloads.

Public Instance methods

Adds a blob to the blob cache so that the payload does not have to be recompiled in the future

This method is called when a new payload module class is loaded up. For the payload set we simply create an instance of the class and do some magic to figure out if it‘s a single, stager, or stage. Depending on which it is, we add it to the appropriate list.

This method adds a single payload to the set and adds it to the singles hash.

This method adds a stage payload to the set and adds it to the stages hash using the supplied handler type.

Checks to see if a payload has a blob cache entry. If it does, the blob is returned to the caller.

Performs custom filtering during each_module enumeration. This allows us to filter out certain stagers as necessary.

Looks for a payload that matches the specified requirements and returns an instance of that payload.

Flushes all entries from the blob cache

Returns a single read-only instance of the supplied payload name such that specific attributes, like compatibility, can be evaluated. The payload instance returned should NOT be used for anything other than reading.

When a payload module is reloaded, the blob cache entry associated with it must be removed (if one exists)

This method builds the hash of alias names based on all the permutations of singles, stagers, and stages.

Returns the hash of payload stagers that have been loaded.

Protected Instance methods

Return the hash of single payloads

Return the hash of stager payloads

Return the hash of stage payloads

Builds a duplicate, extended version of the Payload base class using the supplied modules.

[Validate]