Sha256: ffe96cac1ba738603f2f57533a316d4679d6c7e1f246ff39481bda94d615f167

Contents?: true

Size: 933 Bytes

Versions: 2

Compression:

Stored size: 933 Bytes

Contents

class MetasploitDataModels::AutomaticExploitation::MatchResult < ActiveRecord::Base

  # Running associated exploit did NOT create a session
  FAILED = "failed"
  # Running associated exploit created a session
  SUCCEEDED = "succeeded"

  VALID_STATES = [FAILED, SUCCEEDED]

  #
  # ASSOCIATIONS
  #

  belongs_to :match,
             class_name: 'MetasploitDataModels::AutomaticExploitation::Match',
             inverse_of: :match_results,
             dependent: :destroy

  belongs_to :run,
             inverse_of: :match_results,
             class_name: 'MetasploitDataModels::AutomaticExploitation::Run'

  #
  # VALIDATIONS
  #

  # must be present and one of allowable values
  validates :state,
            presence: true,
            inclusion: VALID_STATES

  #
  # SCOPES
  #
  scope :succeeded, lambda { where(state:"succeeded") }
  scope :failed, lambda { where(state:"failed") }

  Metasploit::Concern.run(self)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metasploit_data_models-1.0.0.pre.rails.pre.4.0b app/models/metasploit_data_models/automatic_exploitation/match_result.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a app/models/metasploit_data_models/automatic_exploitation/match_result.rb