Skip to content

Commit d19c2e7

Browse files
author
Brent Cook
committed
Land rapid7#5544, track updates to SSL Labs API
2 parents 5a548c3 + bf170a1 commit d19c2e7

File tree

1 file changed

+44
-18
lines changed

1 file changed

+44
-18
lines changed

modules/auxiliary/gather/ssllabs_scan.rb

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@ class Cert < ApiObject
180180
:crlURIs,
181181
:ocspURIs,
182182
:revocationStatus,
183+
:crlRevocationStatus,
184+
:ocspRevocationStatus,
183185
:sgc?,
184186
:validationType,
185-
:issues
187+
:issues,
188+
:sct?
186189

187190
def valid?
188191
issues == 0
@@ -196,9 +199,18 @@ def invalid?
196199
class ChainCert < ApiObject
197200
has_fields :subject,
198201
:label,
202+
:notBefore,
203+
:notAfter,
199204
:issuerSubject,
200205
:issuerLabel,
206+
:sigAlg,
201207
:issues,
208+
:keyAlg,
209+
:keySize,
210+
:keyStrength,
211+
:revocationStatus,
212+
:crlRevocationStatus,
213+
:ocspRevocationStatus,
202214
:raw
203215

204216
def valid?
@@ -212,12 +224,7 @@ def invalid?
212224

213225
class Chain < ApiObject
214226
has_objects_list :certs, ChainCert
215-
has_fields :subject,
216-
:label,
217-
:issuerSubject,
218-
:issuerLabel,
219-
:issues,
220-
:raw
227+
has_fields :issues
221228

222229
def valid?
223230
issues == 0
@@ -354,6 +361,8 @@ class EndpointDetails < ApiObject
354361
:npnProtocols,
355362
:sessionTickets,
356363
:ocspStapling?,
364+
:staplingRevocationStatus,
365+
:staplingRevocationErrorMessage,
357366
:sniRequired?,
358367
:httpStatusCode,
359368
:httpForwarding,
@@ -364,8 +373,11 @@ class EndpointDetails < ApiObject
364373
has_fields :heartbleed?,
365374
:heartbeat?,
366375
:openSslCcs,
376+
:poodle?,
367377
:poodleTls,
368-
:fallbackScsv?
378+
:fallbackScsv?,
379+
:freak?,
380+
:hasSct
369381
end
370382

371383
class Endpoint < ApiObject
@@ -375,6 +387,7 @@ class Endpoint < ApiObject
375387
:statusDetails,
376388
:statusDetailsMessage,
377389
:grade,
390+
:gradeTrustIgnored,
378391
:hasWarnings?,
379392
:isExceptional?,
380393
:progress,
@@ -408,7 +421,7 @@ def initialize(info = {})
408421
SSL/TLS assessment during a penetration test.
409422
},
410423
'License' => MSF_LICENSE,
411-
'Author' =>
424+
'Author' =>
412425
[
413426
'Denis Kolegov <dnkolegov[at]gmail.com>',
414427
'Francois Chagnon' # ssllab.rb author (https://github.com/Shopify/ssllabs.rb)
@@ -472,6 +485,8 @@ def output_endpoint_data(r)
472485
report_bad "Overall rating: #{r.grade} - Server's certificate is not trusted"
473486
end
474487

488+
report_warning "Grade is #{r.grade_trust_ignored}, if trust issues are ignored)" if r.grade.to_s != r.grade_trust_ignored.to_s
489+
475490
# Supported protocols
476491
r.details.protocols.each do |i|
477492
p = ssl_protocols.detect { |x| x[:id] == i.id }
@@ -511,7 +526,12 @@ def output_endpoint_data(r)
511526
report_good "BEAST attack - No"
512527
end
513528

514-
# puts "POODLE (SSLv3)- ?"
529+
# POODLE (SSLv3)
530+
if r.details.poodle?
531+
report_bad "POODLE SSLv3 - Vulnerable"
532+
else
533+
report_good "POODLE SSLv3 - Not vulnerable"
534+
end
515535

516536
# POODLE TLS
517537
case r.details.poodle_tls
@@ -520,16 +540,23 @@ def output_endpoint_data(r)
520540
when 0
521541
report_warning "POODLE TLS - Unknown"
522542
when 1
523-
report_good "POODLE TLS - No"
543+
report_good "POODLE TLS - Not vulnerable"
524544
when 2
525-
report_bad "POODLE TLS - Yes"
545+
report_bad "POODLE TLS - Vulnerable"
526546
end
527547

528548
# Downgrade attack prevention
529549
if r.details.fallback_scsv?
530-
report_good "Downgrade attack prevention - Yes"
550+
report_good "Downgrade attack prevention - Yes, TLS_FALLBACK_SCSV supported"
531551
else
532-
report_bad "Downgrade attack prevention - No"
552+
report_bad "Downgrade attack prevention - No, TLS_FALLBACK_SCSV not supported"
553+
end
554+
555+
# Freak
556+
if r.details.freak?
557+
report_bad "Freak - Vulnerable"
558+
else
559+
report_good "Freak - Not vulnerable"
533560
end
534561

535562
# RC4
@@ -553,7 +580,7 @@ def output_endpoint_data(r)
553580
if r.details.heartbleed?
554581
report_bad "Heartbleed (vulnerability) - Yes"
555582
else
556-
report_good "Heartbeat (vulnerability) - No"
583+
report_good "Heartbleed (vulnerability) - No"
557584
end
558585

559586
# OpenSSL CCS
@@ -687,7 +714,7 @@ def output_testing_details(r)
687714
return unless r.status == "IN_PROGRESS"
688715

689716
if r.endpoints.length == 1
690-
print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{r.endpoints[0].progress}% (#{r.endpoints[0].status_details_message})"
717+
print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{[r.endpoints[0].progress, 0].max}% (#{r.endpoints[0].status_details_message})"
691718
elsif r.endpoints.length > 1
692719
in_progress_srv_num = 0
693720
ready_srv_num = 0
@@ -696,7 +723,7 @@ def output_testing_details(r)
696723
case e.status_message.to_s
697724
when "In progress"
698725
in_progress_srv_num += 1
699-
print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{e.progress}% complete (#{e.status_details_message})"
726+
print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{[e.progress, 0].max}% complete (#{e.status_details_message})"
700727
when "Pending"
701728
pending_srv_num += 1
702729
when "Ready"
@@ -715,7 +742,6 @@ def valid_hostname?(hostname)
715742

716743
def run
717744
delay = datastore['DELAY']
718-
719745
hostname = datastore['HOSTNAME']
720746
unless valid_hostname?(hostname)
721747
print_status "Invalid hostname"

0 commit comments

Comments
 (0)