Fix post mixin platform/session check

bug/bundler_fix
OJ 2016-11-05 02:41:52 +10:00
parent e5ea4a53d3
commit 50c2ed8509
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
1 changed files with 2 additions and 4 deletions

View File

@ -166,7 +166,7 @@ module Msf::PostMixin
if self.platform and self.platform.kind_of?(Msf::Module::PlatformList) if self.platform and self.platform.kind_of?(Msf::Module::PlatformList)
[ [
# Add as necessary # Add as necessary
"windows", "linux", "osx" 'win', 'linux', 'osx'
].each do |name| ].each do |name|
if self.platform =~ /#{name}/ if self.platform =~ /#{name}/
p = Msf::Module::PlatformList.transform(name) p = Msf::Module::PlatformList.transform(name)
@ -176,7 +176,7 @@ module Msf::PostMixin
elsif self.platform and self.platform.kind_of?(Msf::Module::Platform) elsif self.platform and self.platform.kind_of?(Msf::Module::Platform)
p_klass = Msf::Module::Platform p_klass = Msf::Module::Platform
case self.platform case self.platform
when 'windows' when 'win'
return false unless self.platform.kind_of?(p_klass::Windows) return false unless self.platform.kind_of?(p_klass::Windows)
when 'osx' when 'osx'
return false unless self.platform.kind_of?(p_klass::OSX) return false unless self.platform.kind_of?(p_klass::OSX)
@ -188,8 +188,6 @@ module Msf::PostMixin
# Check to make sure architectures match # Check to make sure architectures match
mod_arch = self.module_info['Arch'] mod_arch = self.module_info['Arch']
mod_arch = [mod_arch] unless mod_arch.kind_of?(Array) mod_arch = [mod_arch] unless mod_arch.kind_of?(Array)
# TODO: what should be done with the likes of ARCH_CMD (and others) ?
return false unless mod_arch.include?(self.arch)
# If we got here, we haven't found anything that definitely # If we got here, we haven't found anything that definitely
# disqualifies this session. Assume that means we can use it. # disqualifies this session. Assume that means we can use it.