Class: Nmap::XML::Service
- Inherits:
-
Object
- Object
- Nmap::XML::Service
- Includes:
- CPE
- Defined in:
- lib/nmap/xml/service.rb
Overview
Wraps a service
XML element.
Instance Method Summary collapse
-
#confidence ⇒ Integer
The confidence score of the service fingerprinting.
-
#device_type ⇒ String
The reported device type.
-
#extra_info ⇒ String
The extra information from the service scan.
-
#fingerprint ⇒ String
The actual fingerprint.
-
#fingerprint_method ⇒ Symbol
The fingerprint method used to identify the service.
-
#hostname ⇒ String
The hostname reported by the service.
-
#initialize(node) ⇒ Service
constructor
Creates a new OS object.
-
#name ⇒ String
The name of the service.
-
#os_type ⇒ String
The reported OS type.
-
#product ⇒ String
The product of the service.
-
#protocol ⇒ String
The application protocol used by the service.
-
#ssl? ⇒ Boolean
Determines if the service requires SSL.
-
#to_s ⇒ String
Converts the service to a String.
-
#version ⇒ String
The version of the service.
Methods included from CPE
Constructor Details
#initialize(node) ⇒ Service
Creates a new OS object.
22 23 24 |
# File 'lib/nmap/xml/service.rb', line 22 def initialize(node) @node = node end |
Instance Method Details
#confidence ⇒ Integer
The confidence score of the service fingerprinting.
154 155 156 |
# File 'lib/nmap/xml/service.rb', line 154 def confidence @confidence ||= @node.get_attribute('conf').to_i end |
#device_type ⇒ String
The reported device type.
122 123 124 |
# File 'lib/nmap/xml/service.rb', line 122 def device_type @device_type ||= @node['devicetype'] end |
#extra_info ⇒ String
The extra information from the service scan.
88 89 90 |
# File 'lib/nmap/xml/service.rb', line 88 def extra_info @extra_info ||= @node['extrainfo'] end |
#fingerprint ⇒ String
The actual fingerprint
144 145 146 |
# File 'lib/nmap/xml/service.rb', line 144 def fingerprint @fingerprint ||= @node.get_attribute('servicefp') end |
#fingerprint_method ⇒ Symbol
The fingerprint method used to identify the service.
132 133 134 |
# File 'lib/nmap/xml/service.rb', line 132 def fingerprint_method @fingerprint_method ||= @node.get_attribute('method').to_sym end |
#hostname ⇒ String
The hostname reported by the service.
98 99 100 |
# File 'lib/nmap/xml/service.rb', line 98 def hostname @hostname ||= @node.get_attribute('hostname') end |
#name ⇒ String
The name of the service.
32 33 34 |
# File 'lib/nmap/xml/service.rb', line 32 def name @name ||= @node.get_attribute('name') end |
#os_type ⇒ String
The reported OS type.
110 111 112 |
# File 'lib/nmap/xml/service.rb', line 110 def os_type @os_type ||= @node['ostype'] end |
#product ⇒ String
The product of the service.
66 67 68 |
# File 'lib/nmap/xml/service.rb', line 66 def product @product ||= @node.get_attribute('product') end |
#protocol ⇒ String
The application protocol used by the service.
56 57 58 |
# File 'lib/nmap/xml/service.rb', line 56 def protocol @protocol ||= @node['proto'] end |
#ssl? ⇒ Boolean
Determines if the service requires SSL.
44 45 46 |
# File 'lib/nmap/xml/service.rb', line 44 def ssl? (@ssl ||= @node['tunnel']) == 'ssl' end |
#to_s ⇒ String
Converts the service to a String.
164 165 166 167 168 169 170 |
# File 'lib/nmap/xml/service.rb', line 164 def to_s if (product && version) "#{product} #{version}" else name end end |
#version ⇒ String
The version of the service.
76 77 78 |
# File 'lib/nmap/xml/service.rb', line 76 def version @version ||= @node.get_attribute('version') end |