Class: Ncrack::XML::Service
- Inherits:
-
Object
- Object
- Ncrack::XML::Service
- Defined in:
- lib/ncrack/xml/service.rb
Overview
Represents a service
XML element.
Instance Method Summary collapse
-
#address ⇒ Address
The address information of the service.
-
#credential ⇒ Credential?
The first bruteforced credential.
-
#credentials ⇒ Array<Credential>
The bruteforced credentials.
-
#each_credentials {|credential| ... } ⇒ Enumerator
Enumerates over every bruteforced credential.
-
#end_time ⇒ Time
When bruteforcing of the service stopped.
-
#initialize(node) ⇒ Service
constructor
private
Initializes the service object.
-
#port ⇒ Port
The port information of the service.
-
#start_time ⇒ Time
When bruteforcing of the service begin.
Constructor Details
#initialize(node) ⇒ Service
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 service object.
20 21 22 |
# File 'lib/ncrack/xml/service.rb', line 20 def initialize(node) @node = node end |
Instance Method Details
#address ⇒ Address
The address information of the service.
50 51 52 |
# File 'lib/ncrack/xml/service.rb', line 50 def address @address ||= Address.new(@node.at_xpath('address')) end |
#credential ⇒ Credential?
The first bruteforced credential.
98 99 100 |
# File 'lib/ncrack/xml/service.rb', line 98 def credential each_credentials.first end |
#credentials ⇒ Array<Credential>
The bruteforced credentials.
89 90 91 |
# File 'lib/ncrack/xml/service.rb', line 89 def credentials each_credentials.to_a end |
#each_credentials {|credential| ... } ⇒ Enumerator
Enumerates over every bruteforced credential.
76 77 78 79 80 81 82 |
# File 'lib/ncrack/xml/service.rb', line 76 def each_credentials return enum_for(__method__) unless block_given? @node.xpath('credentials').each do |node| yield Credentials.new(node) end end |
#end_time ⇒ Time
When bruteforcing of the service stopped.
40 41 42 |
# File 'lib/ncrack/xml/service.rb', line 40 def end_time @end_time ||= Time.at(@node['endtime'].to_i) end |
#port ⇒ Port
The port information of the service.
60 61 62 |
# File 'lib/ncrack/xml/service.rb', line 60 def port @port ||= Port.new(@node.at_xpath('port')) end |
#start_time ⇒ Time
When bruteforcing of the service begin.
30 31 32 |
# File 'lib/ncrack/xml/service.rb', line 30 def start_time @start_time ||= Time.at(@node['starttime'].to_i) end |