diff --git a/lib/msf/core/session/interactive.rb b/lib/msf/core/session/interactive.rb index 1c55ad6e523e..1548706f443e 100644 --- a/lib/msf/core/session/interactive.rb +++ b/lib/msf/core/session/interactive.rb @@ -24,6 +24,10 @@ def initialize(rstream, opts={}) # A nil is passed in the case of non-stream interactive sessions (Meterpreter) if rstream self.rstream = rstream + begin + @peer_info = rstream.peerinfo + rescue ::Exception + end end super() end @@ -43,7 +47,8 @@ def tunnel_local return @local_info if @local_info begin @local_info = rstream.localinfo - rescue ::Exception + rescue ::Exception => e + elog('Interactive#tunnel_local error', error: e) @local_info = '127.0.0.1' end end @@ -55,7 +60,8 @@ def tunnel_peer return @peer_info if @peer_info begin @peer_info = rstream.peerinfo - rescue ::Exception + rescue ::Exception => e + elog('Interactive#tunnel_peer error', error: e) @peer_info = '127.0.0.1' end end