Land #10790, don't log peer if it represents > 1 target

4.x
Brent Cook 2018-10-12 02:16:04 -05:00 committed by Metasploit
parent 82512a1558
commit 5e27bdec14
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 6 additions and 2 deletions

View File

@ -196,8 +196,12 @@ module Exploit::Remote::Tcp
end
def print_prefix
if rhost
super + peer + " - "
# Only inject a host/port prefix if we have exactly one entry.
# Otherwise we are logging in the global context where rhost can be any
# size (being an alias for rhosts), which is not very useful to insert into
# a single log line.
if rhost && rhost.split(' ').length == 1
super + peer + ' - '
else
super
end