Warn user when session not compat instead of failing

This commit changes the post mixin so that the session compat check only
shows a warning rather than throwing an exception and stopping the
module from working completely.

This is off the back of the discussion involved with #7736
bug/bundler_fix
OJ 2016-12-21 11:14:52 +10:00
parent fa016de78a
commit 1098bc6d90
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
1 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ module Msf::PostMixin
# @raise [OptionValidateError] if {#session} returns nil
def setup
unless session_compatible?(session)
raise Msf::OptionValidateError.new(["SESSION (type not valid for this module)"])
print_warning('SESSION may not be compatible with this module.')
end
super
@ -168,8 +168,8 @@ module Msf::PostMixin
# Check to make sure architectures match
mod_arch = self.module_info['Arch']
unless mod_arch.nil?
mod_arch = [mod_arch] unless mod_arch.kind_of?(Array)
return false unless mod_arch.include? s.arch
mod_arch = [mod_arch] unless mod_arch.kind_of?(Array)
return false unless mod_arch.include?(s.arch)
end
# If we got here, we haven't found anything that definitely