Method: Metasploit::Credential::Login.failed_logins_by_public
- Defined in:
- app/models/metasploit/credential/login.rb
.failed_logins_by_public(host_id) ⇒ Hash{String => Array}
Each username that is related to a login on the passed host and the logins of particular statuses that are related to that public, ordered by the login last attempt date.
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'app/models/metasploit/credential/login.rb', line 181 def self.failed_logins_by_public(host_id) select( [ Metasploit::Credential::Login[Arel.star], Metasploit::Credential::Public[:username] ] ).order(:last_attempted_at). joins( Metasploit::Credential::Login.join_association(:core), Metasploit::Credential::Core.join_association(:public, Arel::Nodes::OuterJoin) ).where( Metasploit::Credential::Core[:id].in( # We are concerned with per-username access attempts. This # can be across any of the cores on a host: Metasploit::Credential::Core.cores_from_host(host_id) ).and( Metasploit::Credential::Login[:status].in( [ Metasploit::Model::Login::Status::DENIED_ACCESS, Metasploit::Model::Login::Status::DISABLED, Metasploit::Model::Login::Status::INCORRECT, ] )) ).group_by(&:username) end |