Class: Mdm::WebSite
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mdm::WebSite
- Defined in:
- app/models/mdm/web_site.rb
Overview
A Web Site running on a #service.
Instance Attribute Summary collapse
-
#comments ⇒ String
User entered comments about this web site.
-
#created_at ⇒ DateTime
When this web site was created.
- #options ⇒ Object
-
#updated_at ⇒ DateTime
The last time this web site was updated.
-
#vhost ⇒ String
The virtual host for the web site in case
service.host.nameorservice.host.addressis no the host for this web site.
Instance Method Summary collapse
-
#form_count ⇒ Integer
Number of #web_forms.
-
#page_count ⇒ Integer
Number of #web_pages.
-
#to_url(ignore_vhost = false) ⇒ String
Converts this web site to its URL, including scheme, host and port.
-
#vuln_count ⇒ Integer
Number of #web_vulns.
Instance Attribute Details
#comments ⇒ String
User entered comments about this web site.
|
|
# File 'app/models/mdm/web_site.rb', line 35
|
#created_at ⇒ DateTime
When this web site was created.
|
|
# File 'app/models/mdm/web_site.rb', line 40
|
#options ⇒ Object
62 |
# File 'app/models/mdm/web_site.rb', line 62 serialize :options, ::MetasploitDataModels::Base64Serializer.new |
#updated_at ⇒ DateTime
The last time this web site was updated.
|
|
# File 'app/models/mdm/web_site.rb', line 45
|
#vhost ⇒ String
The virtual host for the web site in case service.host.name or service.host.address is no the host for this
web site.
|
|
# File 'app/models/mdm/web_site.rb', line 50
|
Instance Method Details
#form_count ⇒ Integer
Number of #web_forms.
71 72 73 |
# File 'app/models/mdm/web_site.rb', line 71 def form_count web_forms.size end |
#page_count ⇒ Integer
Number of #web_pages.
78 79 80 |
# File 'app/models/mdm/web_site.rb', line 78 def page_count web_pages.size end |
#to_url(ignore_vhost = false) ⇒ String
Converts this web site to its URL, including scheme, host and port.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'app/models/mdm/web_site.rb', line 87 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_count ⇒ Integer
Number of #web_vulns.
106 107 108 |
# File 'app/models/mdm/web_site.rb', line 106 def vuln_count web_vulns.size end |