update_info
update_info passes the module’s identity and contract to the framework. It is used for info, show options, payload compatibility, ranking, and more. Always fill in this block separately from the working code.
Where to write it
Section titled “Where to write it”def initialize(info = {}) super( update_info( info, 'Name' => 'ExampleApp Ping Command Injection', 'Description' => %q{ ExampleApp has OS command injection in /ping. Description for the lab. }, 'Author' => ['you'], 'License' => MSF_LICENSE, 'References' => [ ['CVE', '2024-0000'], ['URL', 'https://example.local/advisory'] ], 'DisclosureDate' => '2024-01-01', 'Platform' => ['linux'], 'Arch' => [ARCH_CMD], 'Privileged' => false, 'Targets' => [ ['Automatic', {}] ], 'DefaultTarget' => 0, 'Notes' => { 'Stability' => [CRASH_SAFE], 'Reliability' => [REPEATABLE_SESSION], 'SideEffects' => [IOC_IN_LOGS] } ) )endThe standard form is super(update_info(info, ...)). Passing info merges the metadata without overwriting additions from a parent class or mixin.
Field meanings
Section titled “Field meanings”| Key | Usually required | Meaning |
|---|---|---|
Name | Yes | Short title; include terms users are likely to search |
Description | Yes | Behavior, prerequisites, and cautions; %q{...} supports multiple lines |
Author | Yes | Array; 'name <mail>' is a common form |
License | Yes | Usually MSF_LICENSE |
References | Recommended | ['CVE','...'], ['URL','...'], ['EDB','...'], etc. |
DisclosureDate | Recommended | 'YYYY-MM-DD' |
Platform | Important for exploit | 'linux' / 'win' / 'unix' / 'python', etc.; affects payload compatibility |
Arch | Important for exploit | ARCH_CMD / ARCH_X64 / ARCH_X86 / ARCH_PYTHON, etc. |
Privileged | Optional | Indicates whether high privileges are required or obtained |
Payload | exploit | Payload constraints such as 'Space' and 'BadChars' |
Targets | exploit | Target OS / offsets / CmdStagerFlavor, etc. |
DefaultTarget | exploit | Index into Targets |
SessionTypes | post | 'shell' / 'meterpreter' |
Actions / DefaultAction | auxiliary | For multiple modes |
Notes | Effectively required for new modules | Stability / Reliability / SideEffects |
Why Platform / Arch matter
Section titled “Why Platform / Arch matter”For exploits, if the declared Platform/Arch does not match the payload’s, the available payload list may be empty or execution may fail.
| Purpose | Example |
|---|---|
| Send a command directly | 'Platform' => ['unix','linux'], 'Arch' => [ARCH_CMD] |
| Place an ELF / PE | 'Arch' => [ARCH_X64] + CmdStager |
| Web-language payload | 'Platform' => ['php'], 'Arch' => [ARCH_PHP] |
Targets
Section titled “Targets”'Targets' => [ [ 'Linux Command', { 'Platform' => 'linux', 'Arch' => [ARCH_CMD] } ], [ 'Linux Dropper', { 'Platform' => 'linux', 'Arch' => [ARCH_X64], 'CmdStagerFlavor' => ['bourne', 'curl', 'wget'] } ]],'DefaultTarget' => 0Users switch targets with set TARGET 1. Within a module, use target / target.name / target['Arch'].
Notes (Stability / Reliability / SideEffects)
Section titled “Notes (Stability / Reliability / SideEffects)”This field is expected for new modules. The bundled wiki Definition-of-Module-Reliability-Side-Effects-and-Stability.md defines the constants.
'Notes' => { 'Stability' => [CRASH_SAFE], 'Reliability' => [REPEATABLE_SESSION], 'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK]}| Category | Examples |
|---|---|
| Stability | CRASH_SAFE, CRASH_SERVICE_DOWN |
| Reliability | REPEATABLE_SESSION, UNRELIABLE_SESSION, EVENT_DEPENDENT |
| SideEffects | IOC_IN_LOGS, ARTIFACTS_ON_DISK, CONFIG_CHANGES, ACCOUNT_LOCKOUTS |
Rank (exploit)
Section titled “Rank (exploit)”Place it directly in the class body.
Rank = ExcellentRankingExcellentRanking / GreatRanking / GoodRanking / NormalRanking, etc. This is a self-assessment of reliability.
Auxiliary Actions
Section titled “Auxiliary Actions”'Actions' => [ ['List', { 'Description' => 'Enumerate items' }], ['Dump', { 'Description' => 'Dump config' }]],'DefaultAction' => 'List'Read action.name in run.
Post SessionTypes
Section titled “Post SessionTypes”'Platform' => ['linux', 'unix'],'SessionTypes' => ['shell', 'meterpreter']Only list session types the module actually supports; running it in an unsupported session is likely to fail.
Next, use register_options to define values supplied by users.

