Class: Mdm::WebSite
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- 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.
-
#updated_at ⇒ DateTime
The last time this web site was updated.
-
#vhost ⇒ String
The virtual host for the web site in case
service.host.name
orservice.host.address
is 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 36
|
#created_at ⇒ DateTime
When this web site was created.
|
# File 'app/models/mdm/web_site.rb', line 41
|
#updated_at ⇒ DateTime
The last time this web site was updated.
|
# File 'app/models/mdm/web_site.rb', line 46
|
#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 51
|
Instance Method Details
#form_count ⇒ Integer
Number of #web_forms.
76 77 78 |
# File 'app/models/mdm/web_site.rb', line 76 def form_count web_forms.size end |
#page_count ⇒ Integer
Number of #web_pages.
83 84 85 |
# File 'app/models/mdm/web_site.rb', line 83 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.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'app/models/mdm/web_site.rb', line 92 def to_url(ignore_vhost=false) proto = self.service.name == "https" ? "https" : "http" host = ignore_vhost ? self.service.host.address.to_s : 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.
111 112 113 |
# File 'app/models/mdm/web_site.rb', line 111 def vuln_count web_vulns.size end |