Skip to content

Commit

Permalink
Merge pull request #19185 from dwelch-r7/display-current-action-on-mo…
Browse files Browse the repository at this point in the history
…dule-load

Display current action on module load
  • Loading branch information
smcintyre-r7 authored Nov 14, 2024
2 parents 4c659ed + 0d0631a commit d2ee472
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/msf/core/feature_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FeatureManager
MSSQL_SESSION_TYPE = 'mssql_session_type'
LDAP_SESSION_TYPE = 'ldap_session_type'
SHOW_SUCCESSFUL_LOGINS = 'show_successful_logins'
DISPLAY_MODULE_ACTION = 'display_module_action'

DEFAULTS = [
{
Expand Down Expand Up @@ -124,6 +125,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
4 changes: 4 additions & 0 deletions lib/msf/ui/console/command_dispatcher/modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,10 @@ def cmd_use(*args)
print_status("No payload configured, defaulting to #{chosen_payload}") if chosen_payload
end

if framework.features.enabled?(Msf::FeatureManager::DISPLAY_MODULE_ACTION) && mod.actions.size > 1
print_status "Using action %grn#{mod.action.name}%clr - view all #{mod.actions.size} actions with the %grnshow actions%clr command"
end

mod.init_ui(driver.input, driver.output)
end

Expand Down

0 comments on commit d2ee472

Please sign in to comment.