Skip to content

Commit

Permalink
place current action display behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 committed May 17, 2024
1 parent a164605 commit db986af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/msf/core/feature_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class FeatureManager
MYSQL_SESSION_TYPE = 'mysql_session_type'
MSSQL_SESSION_TYPE = 'mssql_session_type'
LDAP_SESSION_TYPE = 'ldap_session_type'
DISPLAY_MODULE_ACTION = 'display_module_action'

DEFAULTS = [
{
Expand Down Expand Up @@ -116,6 +117,13 @@ class FeatureManager
requires_restart: false,
default_value: true,
developer_notes: 'Enabled in Metasploit 6.4.x'
}.freeze,
{
name: DISPLAY_MODULE_ACTION,
description: 'When enabled after using a module the current action and number of actions will be displayed',
requires_restart: false,
default_value: true,
developer_notes: 'Added as a feature so users can turn it off if they wish to reduce clutter in their terminal'
}.freeze
].freeze

Expand Down
2 changes: 1 addition & 1 deletion lib/msf/ui/console/command_dispatcher/modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def cmd_use(*args)
print_status("No payload configured, defaulting to #{chosen_payload}") if chosen_payload
end

if mod.actions.size > 1
if framework.features.enabled?(Msf::FeatureManager::DISPLAY_MODULE_ACTION) && mod.actions.size > 1
print_status "This module has #{mod.actions.size} actions to select from"
print_status 'Display them all with the %grnshow actions%clr command'
print_status "The current action is set to %grn#{mod.action.name}%clr"
Expand Down

0 comments on commit db986af

Please sign in to comment.