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