Class: Nikto::XML::ScanDetails
- Inherits:
-
Object
- Object
- Nikto::XML::ScanDetails
- Defined in:
- lib/nikto/xml/scan_details.rb
Overview
Represents a scandetails
XML element.
Instance Method Summary collapse
-
#checks ⇒ Integer
How many checks were performed on the target.
-
#each_item {|item| ... } ⇒ Enumerator
Enumerates over the found items.
-
#errors ⇒ Integer
How many errors occurred.
-
#errors? ⇒ Boolean
Determines if any errors occurred.
-
#host_header ⇒ String
The
Host
header. -
#initialize(node) ⇒ ScanDetails
constructor
private
Initializes the scan details object.
-
#items ⇒ Array<Item>
The found items for the target.
-
#site_ip ⇒ String
The site's IP address.
-
#site_name ⇒ String
The site name.
-
#start_time ⇒ Time
When the target started being scanned.
-
#statistics ⇒ Statistics
The statistics associated with the scan.
-
#target_banner ⇒ String
The target's banner value.
-
#target_hostname ⇒ String
The target's hostname.
-
#target_ip ⇒ String
The target's IP address.
-
#target_port ⇒ Integer
The target's port number.
Constructor Details
#initialize(node) ⇒ ScanDetails
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the scan details object.
21 22 23 |
# File 'lib/nikto/xml/scan_details.rb', line 21 def initialize(node) @node = node end |
Instance Method Details
#checks ⇒ Integer
How many checks were performed on the target.
130 131 132 |
# File 'lib/nikto/xml/scan_details.rb', line 130 def checks @checks ||= @node['checks'].to_i end |
#each_item {|item| ... } ⇒ Enumerator
Enumerates over the found items.
146 147 148 149 150 151 152 |
# File 'lib/nikto/xml/scan_details.rb', line 146 def each_item return enum_for(__method__) unless block_given? @node.xpath('item').each do |node| yield Item.new(node) end end |
#errors ⇒ Integer
How many errors occurred.
111 112 113 |
# File 'lib/nikto/xml/scan_details.rb', line 111 def errors @errors ||= @node['errors'].to_i end |
#errors? ⇒ Boolean
Determines if any errors occurred.
120 121 122 |
# File 'lib/nikto/xml/scan_details.rb', line 120 def errors? errors > 0 end |
#host_header ⇒ String
The Host
header.
101 102 103 |
# File 'lib/nikto/xml/scan_details.rb', line 101 def host_header @node['hostheader'] end |
#items ⇒ Array<Item>
The found items for the target.
159 160 161 |
# File 'lib/nikto/xml/scan_details.rb', line 159 def items each_item.to_a end |
#site_ip ⇒ String
The site's IP address.
91 92 93 |
# File 'lib/nikto/xml/scan_details.rb', line 91 def site_ip @node['siteip'] end |
#site_name ⇒ String
The site name.
81 82 83 |
# File 'lib/nikto/xml/scan_details.rb', line 81 def site_name @node['sitename'] end |
#start_time ⇒ Time
When the target started being scanned.
71 72 73 |
# File 'lib/nikto/xml/scan_details.rb', line 71 def start_time @start_time ||= Time.parse(@node['starttime']) end |
#statistics ⇒ Statistics
The statistics associated with the scan.
169 170 171 |
# File 'lib/nikto/xml/scan_details.rb', line 169 def statistics @statistics ||= Statistics.new(@node.at_xpath('statistics')) end |
#target_banner ⇒ String
The target's banner value.
61 62 63 |
# File 'lib/nikto/xml/scan_details.rb', line 61 def @node['targetbanner'] end |
#target_hostname ⇒ String
The target's hostname.
41 42 43 |
# File 'lib/nikto/xml/scan_details.rb', line 41 def target_hostname @node['targethostname'] end |
#target_ip ⇒ String
The target's IP address.
31 32 33 |
# File 'lib/nikto/xml/scan_details.rb', line 31 def target_ip @node['targetip'] end |
#target_port ⇒ Integer
The target's port number.
51 52 53 |
# File 'lib/nikto/xml/scan_details.rb', line 51 def target_port @target_port ||= @node['targetport'].to_i end |