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.
- #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.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
|
#options ⇒ Object
63 |
# File 'app/models/mdm/web_site.rb', line 63 serialize :options, ::MetasploitDataModels::Base64Serializer.new |
#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.
72 73 74 |
# File 'app/models/mdm/web_site.rb', line 72 def form_count web_forms.size end |
#page_count ⇒ Integer
Number of #web_pages.
79 80 81 |
# File 'app/models/mdm/web_site.rb', line 79 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.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'app/models/mdm/web_site.rb', line 88 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.
107 108 109 |
# File 'app/models/mdm/web_site.rb', line 107 def vuln_count web_vulns.size end |