diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index a9269a94eb06c..3b41d272bb8fc 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -4,2840 +4,2857 @@ # Rex # - # # Project # - +require 'English' require 'msf/core/opt_condition' require 'optparse' module Msf -module Ui -module Console -module CommandDispatcher + module Ui + module Console + module CommandDispatcher + ### + # + # Command dispatcher for core framework commands, such as module loading, + # session interaction, && other general things. + # + ### + class Core + # rubocop:disable Style/ClassVars + include Msf::Ui::Console::CommandDispatcher + include Msf::Ui::Console::CommandDispatcher::Common + include Msf::Ui::Console::ModuleOptionTabCompletion + + # Session command options + @@sessions_opts = Rex::Parser::Arguments.new( + ['-c', '--command'] => [ true, 'Run a command on the session given with -i, || all', '' ], + ['-C', '--meterpreter-command'] => [ true, 'Run a Meterpreter Command on the session given with -i, || all', '' ], + ['-h', '--help'] => [ false, 'Help banner' ], + ['-i', '--interact'] => [ true, 'Interact with the supplied session ID', '' ], + ['-l', '--list'] => [ false, 'List all active sessions' ], + ['-v', '--list-verbose'] => [ false, 'List all active sessions in verbose mode' ], + ['-d', '--list-inactive'] => [ false, 'List all inactive sessions' ], + ['-q', '--quiet'] => [ false, 'Quiet mode' ], + ['-k', '--kill'] => [ true, 'Terminate sessions by session ID and/or range', '' ], + ['-K', '--kill-all'] => [ false, 'Terminate all sessions' ], + ['-s', '--script'] => [ true, 'Run a script || module on the session given with -i, || all', '