Skip to content

Commit

Permalink
Land #17036, Set @peer_info in #initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Sep 20, 2022
2 parents 2ee666a + 6c2b441 commit 5992385
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/msf/core/session/interactive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5992385

Please sign in to comment.