Skip to main content

Module Structure in msfconsole

Once inside msfconsole, you can browse an extensive list of available Metasploit modules. Each module follows a path-like structure:
Example:

Module Type Breakdown

The type field is the first level of separation in the Metasploit module tree. It tells you what the module is designed to do.
Not all module types are directly “launchable” as an initial action. Some are supporting components within the framework’s modular architecture.

Interactable Module Types

When using use <no.>, you generally work with initiator/interactable module types such as: To reduce noisy results, use scoped filters during search. Common filters include:
  • cve:<year>
  • platform:<os>
  • type:<auxiliary/exploit/post>
  • rank:<rank>
  • <pattern> (keyword)
This returns modules matching all supplied conditions.

MSF: Specific Search Example

Reading Module Details with info

After selecting a module, info gives metadata, options, targets, references, and payload constraints.

MSF: Module Information Example

Permanent Target Specification

If you want a value available across modules, use setg to define a global option.

MSF: Permanent Target Specification

Targets

Targets are specific operating system profiles used by an exploit module to adapt execution to a vulnerable version. The show targets command behaves differently depending on context:
  • Inside an exploit module: lists available targets for that module.
  • In the root menu: reports that no exploit module is selected.

MSF: Show Targets

When run inside the selected exploit module, options and target data are shown:

MSF: Target Selection

Leaving the target as Automatic lets msfconsole perform service detection before launching the exploit. If you already know the target stack/version, manually select it:

Target Types

Targets can vary by service pack, OS version, architecture, language pack, and other exploit-specific constraints. In practice, correct targeting often requires:
  1. Obtaining a copy of the target binaries.
  2. Using msfpescan to locate a suitable return address.
Module source comments often describe the exact assumptions for each target, including return-address patterns and version-specific constraints.