From 7a6c77ba70939a4475868eead914acd5e395d0c3 Mon Sep 17 00:00:00 2001 From: Ganesh-abc Date: Thu, 19 Mar 2026 11:48:50 -0400 Subject: [PATCH 1/2] Add YARD docs to cmd_version and fix RuboCop lints in Core dispatcher --- lib/msf/ui/console/command_dispatcher/core.rb | 5581 +++++++++-------- 1 file changed, 2799 insertions(+), 2782 deletions(-) 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', '