2017-03-31 15:58:43 +00:00
|
|
|
##
|
2017-07-24 13:26:21 +00:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2017-03-31 15:58:43 +00:00
|
|
|
# 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
|
2017-07-24 13:15:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(
|
|
|
|
update_info(
|
|
|
|
info,
|
|
|
|
'Name' => 'Sample Auxiliary Module',
|
|
|
|
# The description can be multiple lines, but does not preserve formatting.
|
|
|
|
'Description' => 'Sample Auxiliary Module',
|
|
|
|
'Author' => ['Joe Module <joem@example.com>'],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Actions' => [
|
|
|
|
[ 'Default Action' ],
|
|
|
|
[ 'Another Action' ]
|
2017-03-31 15:58:43 +00:00
|
|
|
]
|
2017-07-24 13:15:54 +00:00
|
|
|
)
|
|
|
|
)
|
2017-03-31 15:58:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
print_status("Running the simple auxiliary module with action #{action.name}")
|
|
|
|
end
|
|
|
|
|
|
|
|
# auxiliary modules can register new commands, they all call cmd_* to
|
|
|
|
# dispatch them
|
|
|
|
def auxiliary_commands
|
2017-07-24 13:15:54 +00:00
|
|
|
{ "aux_extra_command" => "Run this auxiliary test commmand" }
|
2017-03-31 15:58:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def cmd_aux_extra_command(*args)
|
2017-07-24 13:15:54 +00:00
|
|
|
print_status("Running inside aux_extra_command(#{args.join(' ')})")
|
2017-03-31 15:58:43 +00:00
|
|
|
end
|
|
|
|
end
|