Sha256: cb33cd586a6b7b25bad874ea8d1f1ac92c8b9cf9877b45fb3fe75659b652df09

Contents?: true

Size: 1.65 KB

Versions: 28

Compression:

Stored size: 1.65 KB

Contents

# Origin of `Metasploit::Credential::Core`s that were gathered by a {#post_reference_name post module} used on a
# {#session}.  Contrast with a {Metasploit::Credential::Origin::Service}, which is for
# {Metasploit::Credential::Origin::Service#module_full_name auxiliary or exploit modules} that gather credentials
# directly from a {Metasploit::Credential::Origin::Service#service service} without the need for a separate post module
# or even a session.
class Metasploit::Credential::Origin::Session < ApplicationRecord
  #
  # Associations
  #

  # @!attribute cores
  #   {Metasploit::Credential::Core Core credentials} imported from {#session} using
  #   {#post_reference_name the post module}.
  #
  #   @return [ActiveRecord::Relation<Metasploit::Credential::Core>]
  has_many :cores,
           as: :origin,
           class_name: 'Metasploit::Credential::Core',
           dependent: :destroy

  # @!attribute session
  #   The session on which {#post_reference_name the post module} was run to gather the {#cores core credentials}.
  #
  #   @return [Mdm::Session]
  belongs_to :session,
             class_name: 'Mdm::Session',
             inverse_of: :credential_origins

  #
  # Attributes
  #

  # @!attribute post_reference_name
  #   The reference name of a `Msf::Post` module.
  #
  #   @return [String] a `Mdm::Module::Detail#refname` for a `Mdm::Module::Detail` where `Mdm::Module:Detail#mtype` is
  #     `'post'.`

  #
  # Validations
  #

  validates :post_reference_name,
            presence: true,
            uniqueness: {
                scope: :session_id
            }
  validates :session,
            presence: true

  Metasploit::Concern.run(self)
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
metasploit-credential-6.0.11 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.10 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.9 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.8 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.7 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.6 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.5 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.4 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.3 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.2 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.1 app/models/metasploit/credential/origin/session.rb
metasploit-credential-6.0.0 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.9 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.8 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.7 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.6 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.5 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.4 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.3 app/models/metasploit/credential/origin/session.rb
metasploit-credential-5.0.2 app/models/metasploit/credential/origin/session.rb