Skip to content

Commit 7376d4d

Browse files
David MaloneyDavid Maloney
authored andcommitted
account for public only credentials in #to_s
SNMP in particular will only have a public, so we need to account for this so we don't output poorly formed text with a trailing ':' char 5266
1 parent c69b6b2 commit 7376d4d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/metasploit/framework/credential.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ def inspect
7575
def to_s
7676
if realm && realm_key == Metasploit::Model::Realm::Key::ACTIVE_DIRECTORY_DOMAIN
7777
"#{self.realm}\\#{self.public}:#{self.private}"
78-
else
78+
elsif self.private
7979
"#{self.public}:#{self.private}#{at_realm}"
80+
else
81+
self.public
8082
end
8183
end
8284

lib/msf/core/auxiliary/auth_brute.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ def print_brute(opts={})
566566
else
567567
level = opts[:level].to_s.strip
568568
end
569-
570569
host_ip = opts[:ip] || opts[:rhost] || opts[:host] || (rhost rescue nil) || datastore['RHOST']
571570
host_port = opts[:port] || opts[:rport] || (rport rescue nil) || datastore['RPORT']
572571
msg = opts[:msg] || opts[:message] || opts[:legacy_msg]

0 commit comments

Comments
 (0)