Skip to content

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.

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]
}
)
)
end

The standard form is super(update_info(info, ...)). Passing info merges the metadata without overwriting additions from a parent class or mixin.

KeyUsually requiredMeaning
NameYesShort title; include terms users are likely to search
DescriptionYesBehavior, prerequisites, and cautions; %q{...} supports multiple lines
AuthorYesArray; 'name <mail>' is a common form
LicenseYesUsually MSF_LICENSE
ReferencesRecommended['CVE','...'], ['URL','...'], ['EDB','...'], etc.
DisclosureDateRecommended'YYYY-MM-DD'
PlatformImportant for exploit'linux' / 'win' / 'unix' / 'python', etc.; affects payload compatibility
ArchImportant for exploitARCH_CMD / ARCH_X64 / ARCH_X86 / ARCH_PYTHON, etc.
PrivilegedOptionalIndicates whether high privileges are required or obtained
PayloadexploitPayload constraints such as 'Space' and 'BadChars'
TargetsexploitTarget OS / offsets / CmdStagerFlavor, etc.
DefaultTargetexploitIndex into Targets
SessionTypespost'shell' / 'meterpreter'
Actions / DefaultActionauxiliaryFor multiple modes
NotesEffectively required for new modulesStability / Reliability / SideEffects

For exploits, if the declared Platform/Arch does not match the payload’s, the available payload list may be empty or execution may fail.

PurposeExample
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' => [
[
'Linux Command',
{
'Platform' => 'linux',
'Arch' => [ARCH_CMD]
}
],
[
'Linux Dropper',
{
'Platform' => 'linux',
'Arch' => [ARCH_X64],
'CmdStagerFlavor' => ['bourne', 'curl', 'wget']
}
]
],
'DefaultTarget' => 0

Users 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]
}
CategoryExamples
StabilityCRASH_SAFE, CRASH_SERVICE_DOWN
ReliabilityREPEATABLE_SESSION, UNRELIABLE_SESSION, EVENT_DEPENDENT
SideEffectsIOC_IN_LOGS, ARTIFACTS_ON_DISK, CONFIG_CHANGES, ACCOUNT_LOCKOUTS

Place it directly in the class body.

Rank = ExcellentRanking

ExcellentRanking / GreatRanking / GoodRanking / NormalRanking, etc. This is a self-assessment of reliability.

'Actions' => [
['List', { 'Description' => 'Enumerate items' }],
['Dump', { 'Description' => 'Dump config' }]
],
'DefaultAction' => 'List'

Read action.name in run.

'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.