@@ -17,19 +17,20 @@ class MetasploitModule < Msf::Auxiliary
17
17
18
18
def initialize
19
19
super (
20
- 'Name' => 'SSH Login Check Scanner' ,
21
- 'Description' => %q{
20
+ 'Name' => 'SSH Login Check Scanner' ,
21
+ 'Description' => %q{
22
22
This module will test ssh logins on a range of machines and
23
23
report successful logins. If you have loaded a database plugin
24
24
and connected to a database this module will record successful
25
25
logins and hosts so you can track your access.
26
26
} ,
27
- 'Author' => [ 'todb' ] ,
27
+ 'Author' => [ 'todb' ] ,
28
28
'References' =>
29
29
[
30
30
[ 'CVE' , '1999-0502' ] # Weak password
31
31
] ,
32
- 'License' => MSF_LICENSE
32
+ 'License' => MSF_LICENSE ,
33
+ 'DefaultOptions' => { 'VERBOSE' => false } # Disable annoying connect errors
33
34
)
34
35
35
36
register_options (
@@ -95,7 +96,6 @@ def session_setup(result, ssh_socket)
95
96
96
97
def run_host ( ip )
97
98
@ip = ip
98
- print_brute :ip => ip , :msg => "Starting bruteforce"
99
99
100
100
cred_collection = Metasploit ::Framework ::CredentialCollection . new (
101
101
blank_passwords : datastore [ 'BLANK_PASSWORDS' ] ,
@@ -138,16 +138,12 @@ def run_host(ip)
138
138
session_setup ( result , scanner . ssh_socket )
139
139
:next_user
140
140
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 } "
144
142
scanner . ssh_socket . close if scanner . ssh_socket && !scanner . ssh_socket . closed?
145
143
invalidate_login ( credential_data )
146
144
:abort
147
145
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 } '"
151
147
invalidate_login ( credential_data )
152
148
scanner . ssh_socket . close if scanner . ssh_socket && !scanner . ssh_socket . closed?
153
149
else
0 commit comments