Land #5427, check payload compatability for set payload fix

bug/bundler_fix
Mo Sadek 2015-07-06 12:56:21 -05:00
commit 25bdf7a50a
No known key found for this signature in database
GPG Key ID: 005BFB70E7624F28
2 changed files with 16 additions and 0 deletions

View File

@ -698,6 +698,20 @@ class Exploit < Msf::Module
(target and target.arch) ? target.arch : (arch == []) ? nil : arch
end
#
# Returns whether the requested payload is compatible with the module.
#
# @param [String] payload_name The payload name
# @return [TrueClass] Payload is compatible.
# @return [FalseClass] Payload is not compatible.
#
def is_payload_compatible?(payload_name)
payload_names = compatible_payloads.collect { |entry| entry[0] }
payload_names.include?(payload_name)
end
#
# Returns a list of compatible payloads based on platform, architecture,
# and size requirements.

View File

@ -571,6 +571,8 @@ class Driver < Msf::Ui::Driver
if (framework and framework.payloads.valid?(val) == false)
return false
elsif active_module.type == 'exploit' && !active_module.is_payload_compatible?(val)
return false
elsif (active_module)
active_module.datastore.clear_non_user_defined
elsif (framework)