Class: SSLyze::XML::Target
- Inherits:
-
Object
- Object
- SSLyze::XML::Target
- Includes:
- Types
- Defined in:
- lib/sslyze/xml/target.rb
Overview
Represents the <target>
XML element.
Constant Summary
Constants included from Types
SSLyze::XML::Types::Boolean, SSLyze::XML::Types::None
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares the other target to this target.
-
#certinfo ⇒ Certinfo?
(also: #cert_info)
Certificate information.
-
#compression ⇒ Compression?
Which compression algorithms are supported.
-
#each_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every SSL/TLS protocol.
-
#each_ssl_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every SSL protocol.
-
#each_tls_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every TLS protocol.
- #fallback ⇒ Fallback?
- #heartbleed ⇒ Heartbleed?
-
#host ⇒ String
The host name of the target.
- #http_headers ⇒ HTTPHeaders?
-
#initialize(node) ⇒ Target
constructor
Initializes the target.
-
#ip ⇒ String
The IP address of the target.
-
#ipaddr ⇒ IPAddr
The IP address of the target.
- #openssl_ccs ⇒ OpenSSLCCS?
-
#port ⇒ Integer
The port number that was scanned.
-
#protocols ⇒ Array<Protocol>
All supported SSL/TLS protocols.
-
#reneg ⇒ Reneg?
(also: #session_renegotiation)
Specifies whether the service supports Session Renegotiation.
- #resum ⇒ Resum?
- #resum_rate ⇒ Resum? (also: #session_resumption)
-
#ssl_protocols ⇒ Array<Protocol>
All supported SSL protocols.
-
#sslv2 ⇒ Protocol?
(also: #ssl_v2)
SSLv2 protocol information.
-
#sslv3 ⇒ Protocol?
(also: #ssl_v3)
SSLv3 protocol information.
-
#tls_protocols ⇒ Array<Protocol>
All supported TLS protocols.
-
#tlsv1 ⇒ Protocol?
(also: #tls_v1)
TLSv1 protocol information.
-
#tlsv1_1 ⇒ Protocol?
(also: #tls_v1_1)
TLSv1.1 protocol information.
-
#tlsv1_2 ⇒ Protocol?
(also: #tls_v1_2)
TLSv1.2 protocol information.
-
#to_s ⇒ String
Convert the target to a String.
Constructor Details
#initialize(node) ⇒ Target
Initializes the target.
30 31 32 |
# File 'lib/sslyze/xml/target.rb', line 30 def initialize(node) @node = node end |
Instance Method Details
#==(other) ⇒ Boolean
Compares the other target to this target.
365 366 367 |
# File 'lib/sslyze/xml/target.rb', line 365 def ==(other) other.kind_of?(self.class) && other.host == host && other.port == port end |
#certinfo ⇒ Certinfo? Also known as: cert_info
Certificate information.
90 91 92 93 94 |
# File 'lib/sslyze/xml/target.rb', line 90 def certinfo @cert_info ||= if (element = @node.at_xpath('certinfo')) Certinfo.new(element) end end |
#compression ⇒ Compression?
Which compression algorithms are supported.
77 78 79 80 81 |
# File 'lib/sslyze/xml/target.rb', line 77 def compression @compression ||= if (element = @node.at_xpath('compression')) Compression.new(element) end end |
#each_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every SSL/TLS protocol.
308 309 310 311 312 313 |
# File 'lib/sslyze/xml/target.rb', line 308 def each_protocol(&block) return enum_for(__method__) unless block each_ssl_protocol(&block) each_tls_protocol(&block) end |
#each_ssl_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every SSL protocol.
241 242 243 244 245 246 |
# File 'lib/sslyze/xml/target.rb', line 241 def each_ssl_protocol return enum_for(__method__) unless block_given? yield sslv2 if sslv2 yield sslv3 if sslv3 end |
#each_tls_protocol {|protocol| ... } ⇒ Enumerator
Iterates over every TLS protocol.
273 274 275 276 277 278 279 |
# File 'lib/sslyze/xml/target.rb', line 273 def each_tls_protocol return enum_for(__method__) unless block_given? yield tlsv1 if tlsv1 yield tlsv1_1 if tlsv1_1 yield tlsv1_2 if tlsv1_2 end |
#fallback ⇒ Fallback?
329 330 331 332 333 |
# File 'lib/sslyze/xml/target.rb', line 329 def fallback @fallback ||= if (element = @node.at_xpath('fallback')) Fallback.new(element) end end |
#heartbleed ⇒ Heartbleed?
103 104 105 106 107 |
# File 'lib/sslyze/xml/target.rb', line 103 def heartbleed @heartbleed ||= if (element = @node.at_xpath('heartbleed')) Heartbleed.new(element) end end |
#host ⇒ String
The host name of the target.
39 40 41 |
# File 'lib/sslyze/xml/target.rb', line 39 def host @host ||= @node['host'] end |
#http_headers ⇒ HTTPHeaders?
114 115 116 117 118 |
# File 'lib/sslyze/xml/target.rb', line 114 def http_headers @http_headers ||= if (element = @node.at_xpath('http_headers')) HTTPHeaders.new(element) end end |
#ip ⇒ String
The IP address of the target.
48 49 50 |
# File 'lib/sslyze/xml/target.rb', line 48 def ip @ip ||= @node['ip'] end |
#ipaddr ⇒ IPAddr
The IP address of the target.
59 60 61 |
# File 'lib/sslyze/xml/target.rb', line 59 def ipaddr IPAddr.new(ip) end |
#openssl_ccs ⇒ OpenSSLCCS?
340 341 342 343 344 |
# File 'lib/sslyze/xml/target.rb', line 340 def openssl_ccs @openssl_ccs ||= if (element = @node.at_xpath('openssl_ccs')) OpenSSLCCS.new(element) end end |
#port ⇒ Integer
The port number that was scanned.
68 69 70 |
# File 'lib/sslyze/xml/target.rb', line 68 def port @port ||= @node['port'].to_i end |
#protocols ⇒ Array<Protocol>
All supported SSL/TLS protocols.
320 321 322 |
# File 'lib/sslyze/xml/target.rb', line 320 def protocols each_protocol.to_a end |
#reneg ⇒ Reneg? Also known as: session_renegotiation
Specifies whether the service supports Session Renegotiation.
127 128 129 130 131 |
# File 'lib/sslyze/xml/target.rb', line 127 def reneg @reneg ||= if (element = @node.at_xpath('reneg')) Reneg.new(element) end end |
#resum ⇒ Resum?
140 141 142 143 144 |
# File 'lib/sslyze/xml/target.rb', line 140 def resum @resum ||= if (element = @node.at_xpath('resum')) Resum.new(element) end end |
#resum_rate ⇒ Resum? Also known as: session_resumption
153 154 155 156 157 |
# File 'lib/sslyze/xml/target.rb', line 153 def resum_rate @resum ||= if (element = @node.at_xpath('resum_rate')) ResumRate.new(element) end end |
#ssl_protocols ⇒ Array<Protocol>
All supported SSL protocols.
253 254 255 |
# File 'lib/sslyze/xml/target.rb', line 253 def ssl_protocols each_ssl_protocol.to_a end |
#sslv2 ⇒ Protocol? Also known as: ssl_v2
SSLv2 protocol information.
166 167 168 169 170 |
# File 'lib/sslyze/xml/target.rb', line 166 def sslv2 @sslv2 ||= if (element = @node.at_xpath('sslv2')) Protocol.new(element) end end |
#sslv3 ⇒ Protocol? Also known as: ssl_v3
SSLv3 protocol information.
179 180 181 182 183 |
# File 'lib/sslyze/xml/target.rb', line 179 def sslv3 @sslv3 ||= if (element = @node.at_xpath('sslv3')) Protocol.new(element) end end |
#tls_protocols ⇒ Array<Protocol>
All supported TLS protocols.
286 287 288 |
# File 'lib/sslyze/xml/target.rb', line 286 def tls_protocols each_tls_protocol.to_a end |
#tlsv1 ⇒ Protocol? Also known as: tls_v1
TLSv1 protocol information.
192 193 194 195 196 |
# File 'lib/sslyze/xml/target.rb', line 192 def tlsv1 @tlsv1 ||= if (element = @node.at_xpath('tlsv1')) Protocol.new(element) end end |
#tlsv1_1 ⇒ Protocol? Also known as: tls_v1_1
TLSv1.1 protocol information.
205 206 207 208 209 |
# File 'lib/sslyze/xml/target.rb', line 205 def tlsv1_1 @tlsv1_1 ||= if (element = @node.at_xpath('tlsv1_1')) Protocol.new(element) end end |
#tlsv1_2 ⇒ Protocol? Also known as: tls_v1_2
TLSv1.2 protocol information.
218 219 220 221 222 |
# File 'lib/sslyze/xml/target.rb', line 218 def tlsv1_2 @tlsv1_2 ||= if (element = @node.at_xpath('tlsv1_2')) Protocol.new(element) end end |
#to_s ⇒ String
Convert the target to a String.
352 353 354 |
# File 'lib/sslyze/xml/target.rb', line 352 def to_s "#{host}:#{port}" end |