Class: Metasploit::Credential::Private

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Model::Search
Defined in:
app/models/metasploit/credential/private.rb

Overview

Base ‘Class` for all private credentials. A private credential is any credential that should not be publicly disclosed, such as a password, password hash, or key file.

Uses Single Table Inheritance to store subclass name in #type per Rails convention.

Direct Known Subclasses

Password, PasswordHash, SSHKey

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#coresActiveRecord::Relation<Metasploit::Credential::Core>

The core credentials that combine this private credential with its public credential and/or realm.

Returns:



17
18
19
20
# File 'app/models/metasploit/credential/private.rb', line 17

has_many :cores,
class_name: 'Metasploit::Credential::Core',
dependent: :destroy,
inverse_of: :private

#created_atDateTime

When this private credential was created.

Returns:

  • (DateTime)


# File 'app/models/metasploit/credential/private.rb', line 26

#dataString

The private data for this credential. The semantic meaning of this data varies based on subclass.

Returns:

  • (String)


# File 'app/models/metasploit/credential/private.rb', line 31

#idInteger?

The id of this private credential in the database. #id sequence is shared across all subclass #types, so #id alone acts as a primary key without the need for a compound primary key (id, type).

Returns:

  • (Integer)

    if saved to database.

  • (nil)

    if not saved to database.



# File 'app/models/metasploit/credential/private.rb', line 36

#typeString

The name of the ‘Class`. Used to instantiate the correct subclass when retrieving records from the database.

Returns:

  • (String)


# File 'app/models/metasploit/credential/private.rb', line 43

#updated_atDateTime

The last time this private credential was updated.

Returns:

  • (DateTime)


# File 'app/models/metasploit/credential/private.rb', line 48

Instance Method Details

#to_sString

A string suitable for displaying to the user

Returns:

  • (String)


101
102
103
# File 'app/models/metasploit/credential/private.rb', line 101

def to_s
  data.to_s
end