Class: Mdm::WebSite

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/mdm/web_site.rb

Instance Method Summary collapse

Instance Method Details

#form_countObject



32
33
34
# File 'app/models/mdm/web_site.rb', line 32

def form_count
  web_forms.size
end

#page_countObject



36
37
38
# File 'app/models/mdm/web_site.rb', line 36

def page_count
  web_pages.size
end

#to_url(ignore_vhost = false) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'app/models/mdm/web_site.rb', line 40

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

#vuln_countObject



56
57
58
# File 'app/models/mdm/web_site.rb', line 56

def vuln_count
  web_vulns.size
end