Sha256: c74f39bf666ff5de2a259010367ab2c40bfb09cb8732327971788aab09b83ac4

Contents?: true

Size: 1.05 KB

Versions: 43

Compression:

Stored size: 1.05 KB

Contents

class Mdm::WebSite < ActiveRecord::Base
  #
  # Relations
  #

  belongs_to :service, :class_name => 'Mdm::Service', :foreign_key => 'service_id'
  has_many :web_forms, :dependent => :destroy, :class_name => 'Mdm::WebForm'
  has_many :web_pages, :dependent => :destroy, :class_name => 'Mdm::WebPage'
  has_many :web_vulns, :dependent => :destroy, :class_name => 'Mdm::WebVuln'

  #
  # Serializations
  #

  serialize :options, ::MetasploitDataModels::Base64Serializer.new

  def form_count
    web_forms.size
  end

  def page_count
    web_pages.size
  end

  def to_url(ignore_vhost=false)
    proto = self.service.name == "https" ? "https" : "http"
    host = ignore_vhost ? self.service.host.address : self.vhost
    port = self.service.port

    if Rex::Socket.is_ipv6?(host)
      host = "[#{host}]"
    end

    url = "#{proto}://#{host}"
    if not ((proto == "http" and port == 80) or (proto == "https" and port == 443))
      url += ":#{port}"
    end
    url
  end

  def vuln_count
    web_vulns.size
  end

  ActiveSupport.run_load_hooks(:mdm_web_site, self)
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
metasploit_data_models-0.17.0-java app/models/mdm/web_site.rb
metasploit_data_models-0.17.0 app/models/mdm/web_site.rb
metasploit_data_models-0.16.9 app/models/mdm/web_site.rb
metasploit_data_models-0.16.9-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.8 app/models/mdm/web_site.rb
metasploit_data_models-0.16.8-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.7-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.7 app/models/mdm/web_site.rb
metasploit_data_models-0.16.6-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.6 app/models/mdm/web_site.rb
metasploit_data_models-0.16.5-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.5 app/models/mdm/web_site.rb
metasploit_data_models-0.16.4-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.4 app/models/mdm/web_site.rb
metasploit_data_models-0.16.3-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.1-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.1 app/models/mdm/web_site.rb
metasploit_data_models-0.16.0-java app/models/mdm/web_site.rb
metasploit_data_models-0.16.0 app/models/mdm/web_site.rb
metasploit_data_models-0.15.2-java app/models/mdm/web_site.rb