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



17
18
19
# File 'app/models/mdm/web_site.rb', line 17

def form_count
  web_forms.size
end

#page_countObject



21
22
23
# File 'app/models/mdm/web_site.rb', line 21

def page_count
  web_pages.size
end

#to_url(ignore_vhost = false) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/models/mdm/web_site.rb', line 25

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



41
42
43
# File 'app/models/mdm/web_site.rb', line 41

def vuln_count
  web_vulns.size
end