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.
20 21 22 |
# File 'lib/nmap/xml/service.rb', line 20 def initialize(node) @node = node end |
Instance Method Details
#confidence ⇒ Integer
The confidence score of the service fingerprinting.
152 153 154 |
# File 'lib/nmap/xml/service.rb', line 152 def confidence @confidence ||= @node.get_attribute('conf').to_i end |
#device_type ⇒ String
The reported device type.
120 121 122 |
# File 'lib/nmap/xml/service.rb', line 120 def device_type @device_type ||= @node['devicetype'] end |
#extra_info ⇒ String
The extra information from the service scan.
86 87 88 |
# File 'lib/nmap/xml/service.rb', line 86 def extra_info @extra_info ||= @node['extrainfo'] end |
#fingerprint ⇒ String
The actual fingerprint
142 143 144 |
# File 'lib/nmap/xml/service.rb', line 142 def fingerprint @fingerprint ||= @node.get_attribute('servicefp') end |
#fingerprint_method ⇒ Symbol
The fingerprint method used to identify the service.
130 131 132 |
# File 'lib/nmap/xml/service.rb', line 130 def fingerprint_method @fingerprint_method ||= @node.get_attribute('method').to_sym end |
#hostname ⇒ String
The hostname reported by the service.
96 97 98 |
# File 'lib/nmap/xml/service.rb', line 96 def hostname @hostname ||= @node.get_attribute('hostname') end |
#name ⇒ String
The name of the service.
30 31 32 |
# File 'lib/nmap/xml/service.rb', line 30 def name @name ||= @node.get_attribute('name') end |
#os_type ⇒ String
The reported OS type.
108 109 110 |
# File 'lib/nmap/xml/service.rb', line 108 def os_type @os_type ||= @node['ostype'] end |
#product ⇒ String
The product of the service.
64 65 66 |
# File 'lib/nmap/xml/service.rb', line 64 def product @product ||= @node.get_attribute('product') end |
#protocol ⇒ String
The application protocol used by the service.
54 55 56 |
# File 'lib/nmap/xml/service.rb', line 54 def protocol @protocol ||= @node['proto'] end |
#ssl? ⇒ Boolean
Determines if the service requires SSL.
42 43 44 |
# File 'lib/nmap/xml/service.rb', line 42 def ssl? (@ssl ||= @node['tunnel']) == 'ssl' end |
#to_s ⇒ String
Converts the service to a String.
162 163 164 165 166 167 168 |
# File 'lib/nmap/xml/service.rb', line 162 def to_s if (product && version) "#{product} #{version}" else name end end |
#version ⇒ String
The version of the service.
74 75 76 |
# File 'lib/nmap/xml/service.rb', line 74 def version @version ||= @node.get_attribute('version') end |