Fix #3886 - Backtrace for #check when session is invalid

If the user supplies an invalid session (as in not on the session
list), it will cause a backtrace, because the setup method from
Msf::PostMixin isn't actually called.

We have thought about implementing this in a new OptSession instead.
But you can't use or even pass framework to option_container.rb, so
this is NOT possible.

The original PR was #3956.
bug/bundler_fix
sinn3r 2014-12-02 17:22:46 -06:00
parent fb439258b9
commit f6f0050f56
3 changed files with 6 additions and 0 deletions

View File

@ -113,6 +113,8 @@ module Auxiliary
# be normalized
mod.validate
mod.setup
# Run check
mod.check
end

View File

@ -182,6 +182,8 @@ module Exploit
# be normalized
mod.validate
mod.setup
# Run check
mod.check
end

View File

@ -3,6 +3,8 @@
module Msf::Post::Common
def rhost
return nil unless session
case session.type
when 'meterpreter'
session.sock.peerhost