Land #11768, implement faster compatible payload logic

4.x
Brent Cook 2019-04-24 05:17:15 -05:00 committed by Metasploit
parent 7c4502122e
commit 8235380a90
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 12 additions and 5 deletions

View File

@ -762,12 +762,19 @@ class Exploit < Msf::Module
c_platform, c_arch = normalize_platform_arch
framework.payloads.each_module(
'Arch' => c_arch, 'Platform' => c_platform) { |name, mod|
payloads << [ name, mod ] if is_payload_compatible?(name)
}
results = Msf::Modules::Metadata::Cache.instance.find(
'type' => [['payload'], []],
'platform' => [[*c_platform.names, 'All'], []], # "All" for generic
'arch' => [c_arch, []]
)
return payloads;
results.each do |res|
if is_payload_compatible?(res.ref_name)
payloads << [res.ref_name, framework.payloads[res.ref_name]]
end
end
payloads
end
#