Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/example.rb
Views: 11766
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45###6#7# This sample auxiliary module simply displays the selected action and8# registers a custom command that will show up when the module is used.9#10###11class MetasploitModule < Msf::Auxiliary12def initialize(info = {})13super(14update_info(15info,16'Name' => 'Sample Auxiliary Module',17# The description can be multiple lines, but does not preserve formatting.18'Description' => 'Sample Auxiliary Module',19'Author' => ['Joe Module <[email protected]>'],20'License' => MSF_LICENSE,21'Actions' => [22[ 'Default Action', { 'Description' => 'This does something' } ],23[ 'Another Action', { 'Description' => 'This does a different thing' } ]24],25# The action(s) that will run as background job26'PassiveActions' => [27'Another Action'28],29# https://docs.metasploit.com/docs/development/developing-modules/module-metadata/definition-of-module-reliability-side-effects-and-stability.html30'Notes' => {31'Stability' => [],32'Reliability' => [],33'SideEffects' => []34},35'DefaultAction' => 'Default Action'36)37)38end3940def run41print_status("Running the simple auxiliary module with action #{action.name}")42end4344# Framework automatically registers `cmd_*` methods to be dispatched when the45# corresponding command is used. For example, here this method will be called46# when entering the `aux_extra_command` command in the console.47def cmd_aux_extra_command(*args)48print_status("Running inside aux_extra_command(#{args.join(' ')})")49end50end515253