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
parent
fb439258b9
commit
f6f0050f56
|
@ -113,6 +113,8 @@ module Auxiliary
|
|||
# be normalized
|
||||
mod.validate
|
||||
|
||||
mod.setup
|
||||
|
||||
# Run check
|
||||
mod.check
|
||||
end
|
||||
|
|
|
@ -182,6 +182,8 @@ module Exploit
|
|||
# be normalized
|
||||
mod.validate
|
||||
|
||||
mod.setup
|
||||
|
||||
# Run check
|
||||
mod.check
|
||||
end
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
module Msf::Post::Common
|
||||
|
||||
def rhost
|
||||
return nil unless session
|
||||
|
||||
case session.type
|
||||
when 'meterpreter'
|
||||
session.sock.peerhost
|
||||
|
|
Loading…
Reference in New Issue