Files
metasploit-gs/modules/auxiliary/example.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.7 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
###
#
# This sample auxiliary module simply displays the selected action and
# registers a custom command that will show up when the module is used.
#
###
class MetasploitModule < Msf::Auxiliary
def initialize(info = {})
super(
update_info(
info,
2021-11-13 04:33:24 -05:00
'Name' => 'Sample Auxiliary Module',
# The description can be multiple lines, but does not preserve formatting.
2021-11-13 04:33:24 -05:00
'Description' => 'Sample Auxiliary Module',
'Author' => ['Joe Module <joem@example.com>'],
'License' => MSF_LICENSE,
'Actions' => [
[ 'Default Action', { 'Description' => 'This does something' } ],
[ 'Another Action', { 'Description' => 'This does a different thing' } ]
],
# The action(s) that will run as background job
'PassiveActions' => [
'Another Action'
],
# https://docs.metasploit.com/docs/development/developing-modules/module-metadata/definition-of-module-reliability-side-effects-and-stability.html
2021-11-13 04:33:24 -05:00
'Notes' => {
'Stability' => [],
'Reliability' => [],
'SideEffects' => []
},
'DefaultAction' => 'Default Action'
)
)
end
def run
print_status("Running the simple auxiliary module with action #{action.name}")
end
2024-04-26 16:51:08 +02:00
# Framework automatically registers `cmd_*` methods to be dispatched when the
# corresponding command is used. For example, here this method will be called
# when entering the `aux_extra_command` command in the console.
def cmd_aux_extra_command(*args)
print_status("Running inside aux_extra_command(#{args.join(' ')})")
end
end