diff --git a/lib/msf/core/constants.rb b/lib/msf/core/constants.rb index db064f4183..29cc72fb90 100644 --- a/lib/msf/core/constants.rb +++ b/lib/msf/core/constants.rb @@ -14,7 +14,7 @@ MODULE_ANY = '_any_' MODULE_ENCODER = 'encoder' MODULE_EXPLOIT = 'exploit' MODULE_NOP = 'nop' -MODULE_AUX = 'aux' +MODULE_AUX = 'auxiliary' MODULE_PAYLOAD = 'payload' MODULE_TYPES = [ diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 8c1034b994..c6c6f4567a 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -779,7 +779,7 @@ class Core show_exploits when 'payloads' show_payloads - when 'aux' + when 'auxiliary' show_auxiliary when 'options' if (mod) @@ -821,7 +821,7 @@ class Core # Tab completion for the show command # def cmd_show_tabs(str, words) - res = %w{all encoders nops exploits payloads aux plugins} + res = %w{all encoders nops exploits payloads auxiliary plugins} if (active_module) res.concat(%w{ options advanced evasion targets actions }) end diff --git a/modules/auxiliary/recon.rb b/modules/auxiliary/recon.rb new file mode 100644 index 0000000000..f0ec891477 --- /dev/null +++ b/modules/auxiliary/recon.rb @@ -0,0 +1,75 @@ +require 'msf/core' + +module Msf + +class Auxiliary::ReconTest < Msf::Auxiliary + + include Auxiliary::Recon + include Exploit::Remote::Tcp + + def initialize + super( + 'Name' => 'Simple Recon Module Tester', + 'Version' => '$Revision$', + 'Description' => 'Simple Recon Module Tester', + 'Author' => 'hdm', + 'License' => MSF_LICENSE, + 'Actions' => + [ + ['Single Port Probe'], + ['Continuous Port Sweep'] + ], + 'PassiveActions' => + [ + 'Continuous Port Sweep' + ] + ) + + register_options( + [ + Opt::RHOST, + Opt::RPORT, + ], self.class) + + end + + def run + print_status("Running the simple recon module with action #{action.name}") + + case action.name + when 'Single Port Probe' + prober() + + when 'Continuous Port Sweep' + while (true) + 1.upto(65535) do |port| + datastore['RPORT'] = port + prober() + end + end + end + end + + def prober + begin + connect + disconnect + report_host(:host => datastore['RHOST']) + report_service( + :host => datastore['RHOST'], + :port => datastore['RPORT'], + :proto => 'tcp' + ) + rescue ::Exception => e + case e.to_s + when /connection was refused/ + report_host(:host => datastore['RHOST']) + else + print_status(e.to_s) + end + end + end + + +end +end diff --git a/modules/auxiliary/test.rb b/modules/auxiliary/test.rb new file mode 100644 index 0000000000..82272ec549 --- /dev/null +++ b/modules/auxiliary/test.rb @@ -0,0 +1,37 @@ +require 'msf/core' + +module Msf + +class Auxiliary::Test < Msf::Auxiliary + + def initialize + super( + 'Name' => 'Simple Auxiliary Module Tester', + 'Version' => '$Revision$', + 'Description' => 'Simple Auxiliary Module Tester', + 'Author' => 'hdm', + 'License' => MSF_LICENSE, + 'Actions' => + [ + ['Default Action'], + ['Another Action'] + ] + ) + + end + + def run + print_status("Running the simple auxiliary module with action #{action.name}") + end + + def auxiliary_commands + return { "aux_extra_command" => "Run this auxiliary test commmand" } + end + + def cmd_aux_extra_command(*args) + print_status("Running inside aux_extra_command()") + end + +end + +end