Merge pull request #29 from jvazquez-r7/review_5427
Use compatible_payloads instead of copy and pastebug/bundler_fix
commit
d121ca443a
|
@ -707,36 +707,9 @@ class Exploit < Msf::Module
|
|||
# @return [FalseClass] Payload is not compatible.
|
||||
#
|
||||
def is_payload_compatible?(payload_name)
|
||||
c_platform = (target and target.platform) ? target.platform : platform
|
||||
c_arch = (target and target.arch) ? target.arch : (arch == []) ? nil : arch
|
||||
c_arch ||= [ ARCH_X86 ]
|
||||
payload_names = compatible_payloads.collect { |entry| entry[0] }
|
||||
|
||||
framework.payloads.each_module(
|
||||
'Platform' => c_platform,
|
||||
'Arch' => c_arch ) { |name, mod|
|
||||
|
||||
# Skip over payloads that are too big
|
||||
if ((payload_space) and
|
||||
(framework.payloads.sizes[name]) and
|
||||
(framework.payloads.sizes[name] > payload_space))
|
||||
dlog("#{refname}: Skipping payload #{name} for being too large", 'core',
|
||||
LEV_1)
|
||||
next
|
||||
end
|
||||
|
||||
# Are we compatible in terms of conventions and connections and
|
||||
# what not?
|
||||
next if (compatible?(framework.payloads.instance(name)) == false)
|
||||
|
||||
# If the payload is privileged but the exploit does not give
|
||||
# privileged access, then fail it.
|
||||
next if (self.privileged == false and framework.payloads.instance(name).privileged == true)
|
||||
|
||||
# This one be compatible!
|
||||
return true if payload_name == name
|
||||
}
|
||||
|
||||
false
|
||||
payload_names.include?(payload_name)
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue