Land #11768, implement faster compatible payload logic

master
Brent Cook 2019-04-24 05:17:15 -05:00
commit a9bb4efe6a
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 12 additions and 5 deletions

View File

@ -761,12 +761,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
#