Land #5544, track updates to SSL Labs API

bug/bundler_fix
Brent Cook 2015-06-19 11:39:38 -05:00
commit d19c2e7206
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 44 additions and 18 deletions

View File

@ -180,9 +180,12 @@ class Metasploit3 < Msf::Auxiliary
:crlURIs, :crlURIs,
:ocspURIs, :ocspURIs,
:revocationStatus, :revocationStatus,
:crlRevocationStatus,
:ocspRevocationStatus,
:sgc?, :sgc?,
:validationType, :validationType,
:issues :issues,
:sct?
def valid? def valid?
issues == 0 issues == 0
@ -196,9 +199,18 @@ class Metasploit3 < Msf::Auxiliary
class ChainCert < ApiObject class ChainCert < ApiObject
has_fields :subject, has_fields :subject,
:label, :label,
:notBefore,
:notAfter,
:issuerSubject, :issuerSubject,
:issuerLabel, :issuerLabel,
:sigAlg,
:issues, :issues,
:keyAlg,
:keySize,
:keyStrength,
:revocationStatus,
:crlRevocationStatus,
:ocspRevocationStatus,
:raw :raw
def valid? def valid?
@ -212,12 +224,7 @@ class Metasploit3 < Msf::Auxiliary
class Chain < ApiObject class Chain < ApiObject
has_objects_list :certs, ChainCert has_objects_list :certs, ChainCert
has_fields :subject, has_fields :issues
:label,
:issuerSubject,
:issuerLabel,
:issues,
:raw
def valid? def valid?
issues == 0 issues == 0
@ -354,6 +361,8 @@ class Metasploit3 < Msf::Auxiliary
:npnProtocols, :npnProtocols,
:sessionTickets, :sessionTickets,
:ocspStapling?, :ocspStapling?,
:staplingRevocationStatus,
:staplingRevocationErrorMessage,
:sniRequired?, :sniRequired?,
:httpStatusCode, :httpStatusCode,
:httpForwarding, :httpForwarding,
@ -364,8 +373,11 @@ class Metasploit3 < Msf::Auxiliary
has_fields :heartbleed?, has_fields :heartbleed?,
:heartbeat?, :heartbeat?,
:openSslCcs, :openSslCcs,
:poodle?,
:poodleTls, :poodleTls,
:fallbackScsv? :fallbackScsv?,
:freak?,
:hasSct
end end
class Endpoint < ApiObject class Endpoint < ApiObject
@ -375,6 +387,7 @@ class Metasploit3 < Msf::Auxiliary
:statusDetails, :statusDetails,
:statusDetailsMessage, :statusDetailsMessage,
:grade, :grade,
:gradeTrustIgnored,
:hasWarnings?, :hasWarnings?,
:isExceptional?, :isExceptional?,
:progress, :progress,
@ -472,6 +485,8 @@ class Metasploit3 < Msf::Auxiliary
report_bad "Overall rating: #{r.grade} - Server's certificate is not trusted" report_bad "Overall rating: #{r.grade} - Server's certificate is not trusted"
end end
report_warning "Grade is #{r.grade_trust_ignored}, if trust issues are ignored)" if r.grade.to_s != r.grade_trust_ignored.to_s
# Supported protocols # Supported protocols
r.details.protocols.each do |i| r.details.protocols.each do |i|
p = ssl_protocols.detect { |x| x[:id] == i.id } p = ssl_protocols.detect { |x| x[:id] == i.id }
@ -511,7 +526,12 @@ class Metasploit3 < Msf::Auxiliary
report_good "BEAST attack - No" report_good "BEAST attack - No"
end end
# puts "POODLE (SSLv3)- ?" # POODLE (SSLv3)
if r.details.poodle?
report_bad "POODLE SSLv3 - Vulnerable"
else
report_good "POODLE SSLv3 - Not vulnerable"
end
# POODLE TLS # POODLE TLS
case r.details.poodle_tls case r.details.poodle_tls
@ -520,16 +540,23 @@ class Metasploit3 < Msf::Auxiliary
when 0 when 0
report_warning "POODLE TLS - Unknown" report_warning "POODLE TLS - Unknown"
when 1 when 1
report_good "POODLE TLS - No" report_good "POODLE TLS - Not vulnerable"
when 2 when 2
report_bad "POODLE TLS - Yes" report_bad "POODLE TLS - Vulnerable"
end end
# Downgrade attack prevention # Downgrade attack prevention
if r.details.fallback_scsv? if r.details.fallback_scsv?
report_good "Downgrade attack prevention - Yes" report_good "Downgrade attack prevention - Yes, TLS_FALLBACK_SCSV supported"
else else
report_bad "Downgrade attack prevention - No" report_bad "Downgrade attack prevention - No, TLS_FALLBACK_SCSV not supported"
end
# Freak
if r.details.freak?
report_bad "Freak - Vulnerable"
else
report_good "Freak - Not vulnerable"
end end
# RC4 # RC4
@ -553,7 +580,7 @@ class Metasploit3 < Msf::Auxiliary
if r.details.heartbleed? if r.details.heartbleed?
report_bad "Heartbleed (vulnerability) - Yes" report_bad "Heartbleed (vulnerability) - Yes"
else else
report_good "Heartbeat (vulnerability) - No" report_good "Heartbleed (vulnerability) - No"
end end
# OpenSSL CCS # OpenSSL CCS
@ -687,7 +714,7 @@ class Metasploit3 < Msf::Auxiliary
return unless r.status == "IN_PROGRESS" return unless r.status == "IN_PROGRESS"
if r.endpoints.length == 1 if r.endpoints.length == 1
print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{r.endpoints[0].progress}% (#{r.endpoints[0].status_details_message})" print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{[r.endpoints[0].progress, 0].max}% (#{r.endpoints[0].status_details_message})"
elsif r.endpoints.length > 1 elsif r.endpoints.length > 1
in_progress_srv_num = 0 in_progress_srv_num = 0
ready_srv_num = 0 ready_srv_num = 0
@ -696,7 +723,7 @@ class Metasploit3 < Msf::Auxiliary
case e.status_message.to_s case e.status_message.to_s
when "In progress" when "In progress"
in_progress_srv_num += 1 in_progress_srv_num += 1
print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{e.progress}% complete (#{e.status_details_message})" print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{[e.progress, 0].max}% complete (#{e.status_details_message})"
when "Pending" when "Pending"
pending_srv_num += 1 pending_srv_num += 1
when "Ready" when "Ready"
@ -715,7 +742,6 @@ class Metasploit3 < Msf::Auxiliary
def run def run
delay = datastore['DELAY'] delay = datastore['DELAY']
hostname = datastore['HOSTNAME'] hostname = datastore['HOSTNAME']
unless valid_hostname?(hostname) unless valid_hostname?(hostname)
print_status "Invalid hostname" print_status "Invalid hostname"