Skip to content

Commit 39e5980

Browse files
committed
Fix annoying print_brute messages in ssh_login
1 parent f71ca92 commit 39e5980

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

modules/auxiliary/scanner/ssh/ssh_login.rb

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,20 @@ class MetasploitModule < Msf::Auxiliary
1717

1818
def initialize
1919
super(
20-
'Name' => 'SSH Login Check Scanner',
21-
'Description' => %q{
20+
'Name' => 'SSH Login Check Scanner',
21+
'Description' => %q{
2222
This module will test ssh logins on a range of machines and
2323
report successful logins. If you have loaded a database plugin
2424
and connected to a database this module will record successful
2525
logins and hosts so you can track your access.
2626
},
27-
'Author' => ['todb'],
27+
'Author' => ['todb'],
2828
'References' =>
2929
[
3030
[ 'CVE', '1999-0502'] # Weak password
3131
],
32-
'License' => MSF_LICENSE
32+
'License' => MSF_LICENSE,
33+
'DefaultOptions' => {'VERBOSE' => false} # Disable annoying connect errors
3334
)
3435

3536
register_options(
@@ -95,7 +96,6 @@ def session_setup(result, ssh_socket)
9596

9697
def run_host(ip)
9798
@ip = ip
98-
print_brute :ip => ip, :msg => "Starting bruteforce"
9999

100100
cred_collection = Metasploit::Framework::CredentialCollection.new(
101101
blank_passwords: datastore['BLANK_PASSWORDS'],
@@ -138,16 +138,12 @@ def run_host(ip)
138138
session_setup(result, scanner.ssh_socket)
139139
:next_user
140140
when Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
141-
if datastore['VERBOSE']
142-
print_brute :level => :verror, :ip => ip, :msg => "Could not connect: #{result.proof}"
143-
end
141+
vprint_brute :level => :verror, :ip => ip, :msg => "Could not connect: #{result.proof}"
144142
scanner.ssh_socket.close if scanner.ssh_socket && !scanner.ssh_socket.closed?
145143
invalidate_login(credential_data)
146144
:abort
147145
when Metasploit::Model::Login::Status::INCORRECT
148-
if datastore['VERBOSE']
149-
print_brute :level => :verror, :ip => ip, :msg => "Failed: '#{result.credential}'"
150-
end
146+
vprint_brute :level => :verror, :ip => ip, :msg => "Failed: '#{result.credential}'"
151147
invalidate_login(credential_data)
152148
scanner.ssh_socket.close if scanner.ssh_socket && !scanner.ssh_socket.closed?
153149
else

0 commit comments

Comments
 (0)