Sha256: f87aad277d2c2327d230fabada2563d1ec354c0b6d887c428e313b3f6f94bfa3

Contents?: true

Size: 878 Bytes

Versions: 60

Compression:

Stored size: 878 Bytes

Contents

# Emulates the deprecated `app` operator by converting it to the union of `authors.name:<value>`,
# `email_addresses.local<value before '@'>`, and `email_addresses.domain:<value before '@'>` in {#operate_on}.
class Metasploit::Model::Search::Operator::Deprecated::App < Metasploit::Model::Search::Operator::Delegation
  #
  # CONSTANTS
  #

  # Maps values passed to deprecated `app` operator to the equivalent value for the `stance` operator.
  STANCE_BY_APP = {
      'client' => 'passive',
      'server' => 'aggressive'
  }

  #
  # Methods
  #

  # Converts `app:client` to `stance:passive` and `app:server` to `stance:aggressive`.
  #
  # @return [Metasploit::Model::Search::Operation::Base]
  def operate_on(formatted_value)
    stance_value = STANCE_BY_APP[formatted_value]
    stance_operator = operator('stance')

    stance_operator.operate_on(stance_value)
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
metasploit-model-0.27.4 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.27.4-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.27.0.pre.dep.pre.railties app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.26.1-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.26.1 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.7 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.7-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.6 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.6-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.3 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.3-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.2 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.2-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.1 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.1-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.24.1-java app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.24.1 app/models/metasploit/model/search/operator/deprecated/app.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 app/models/metasploit/model/search/operator/deprecated/app.rb