Land #11768, implement faster compatible payload logic
parent
7c4502122e
commit
8235380a90
|
@ -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
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue