diff --git a/lib/msf/core/feature_manager.rb b/lib/msf/core/feature_manager.rb index 227e3e9757a2c..73595b29655d3 100644 --- a/lib/msf/core/feature_manager.rb +++ b/lib/msf/core/feature_manager.rb @@ -18,6 +18,7 @@ class FeatureManager DATASTORE_FALLBACKS = 'datastore_fallbacks' FULLY_INTERACTIVE_SHELLS = 'fully_interactive_shells' MANAGER_COMMANDS = 'manager_commands' + METASPLOIT_PAYLOAD_WARNINGS = 'metasploit_payload_warnings' DEFAULTS = [ { name: WRAPPED_TABLES, @@ -39,6 +40,12 @@ class FeatureManager description: 'When enabled you can consistently set username across modules, instead of setting SMBUser/FTPUser/BIND_DN/etc', requires_restart: true, default_value: true + }.freeze, + { + name: METASPLOIT_PAYLOAD_WARNINGS, + description: 'hen enabled Metasploit will output warnings about missing Metasploit payloads, for instance if they were removed by antivirus etc', + requires_restart: true, + default_value: false }.freeze ].freeze diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index 7289906b996f6..4b82016533283 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -364,16 +364,18 @@ def on_startup(opts = {}) run_single("banner") unless opts['DisableBanner'] - payloads_manifest_errors = ::MetasploitPayloads.manifest_errors + payloads_manifest_errors = framework.features.enabled?(::Msf::FeatureManager::METASPLOIT_PAYLOAD_WARNINGS) ? ::MetasploitPayloads.manifest_errors : [] av_warning_message if (framework.eicar_corrupted? || payloads_manifest_errors.any?) - if payloads_manifest_errors.any? - warn_msg = "Metasploit Payloads manifest errors:\n" - payloads_manifest_errors.each do |file| - warn_msg << "\t#{file[:path]} : #{file[:error]}\n" + if framework.features.enabled?(::Msf::FeatureManager::METASPLOIT_PAYLOAD_WARNINGS) + if payloads_manifest_errors.any? + warn_msg = "Metasploit Payloads manifest errors:\n" + payloads_manifest_errors.each do |file| + warn_msg << "\t#{file[:path]} : #{file[:error]}\n" + end + $stderr.print(warn_msg) end - $stderr.print(warn_msg) end opts["Plugins"].each do |plug|