Land #18610, Enables Payloads File Warning

This PR enables the Metasploit Payload Warnings feature
by default. When enabled Metasploit will output warnings
about missing Metasploit payloads, for instance if they
were removed by antivirus etc.
This commit is contained in:
Jack Heysel
2023-12-27 14:20:04 -05:00
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ module Msf
name: METASPLOIT_PAYLOAD_WARNINGS,
description: 'When enabled Metasploit will output warnings about missing Metasploit payloads, for instance if they were removed by antivirus etc',
requires_restart: true,
default_value: false,
default_value: true,
developer_notes: 'Planned for default enablement in: Metasploit 6.4.x'
}.freeze,
{
+7 -1
View File
@@ -377,7 +377,13 @@ class Driver < Msf::Ui::Driver
run_single("banner") unless opts['DisableBanner']
payloads_manifest_errors = framework.features.enabled?(::Msf::FeatureManager::METASPLOIT_PAYLOAD_WARNINGS) ? ::MetasploitPayloads.manifest_errors : []
payloads_manifest_errors = []
begin
payloads_manifest_errors = ::MetasploitPayloads.manifest_errors if framework.features.enabled?(::Msf::FeatureManager::METASPLOIT_PAYLOAD_WARNINGS)
rescue ::StandardError => e
$stderr.print('Could not verify the integrity of the Metasploit Payloads manifest')
elog(e)
end
av_warning_message if (framework.eicar_corrupted? || payloads_manifest_errors.any?)