Skip to content

Commit 6229706

Browse files
author
Rory McCune
committed
Updates to access and test ssl checkers
1 parent 9bd652b commit 6229706

File tree

2 files changed

+69
-54
lines changed

2 files changed

+69
-54
lines changed

raccess-checker.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def initialize(arguments)
135135
if @options.debug
136136
@http = Net::HTTP::Proxy(PROXY_SERVER,PROXY_PORT).new(@options.host,@options.port)
137137
@https = Net::HTTP::Proxy(PROXY_SERVER,PROXY_PORT).new(@options.host,@options.port)
138+
puts 'doing debug mode'
138139
else
139140
@http = Net::HTTP.new(@options.host,@options.port)
140141
@https = Net::HTTP.new(@options.host,@options.port)

testsslautoanalyzer.rb

Lines changed: 68 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def parse_files
148148
def parse_file(doc)
149149
address = doc[0]['ip']
150150
@host_results[address] = Hash.new
151+
151152

152153

153154
#testSSL JSON files are an array of elements, it's nicer for this to be able to key off a hash of the id
@@ -161,16 +162,17 @@ def parse_file(doc)
161162
host_names << sans.split(' ')
162163
host_names << address.split('/')[0]
163164

165+
@host_results[address]['port'] = results['service']['port']
164166

165167
#Self Signed Certificate Checks
166-
if results['trust']['finding'].downcase =~ /self signed/
168+
if results['chain_of_trust']['finding'].downcase =~ /self signed/
167169
@host_results[address]['self_signed'] = true
168170
else
169171
@host_results[address]['self_signed'] = false
170172
end
171173

172174
#Untrusted Issuer
173-
if results['trust']['finding'].downcase =~ /chain incomplete/
175+
if results['chain_of_trust']['finding'].downcase =~ /all certificate trust checks failed/
174176
@host_results[address]['untrusted_issuer'] = true
175177
else
176178
@host_results[address]['untrusted_issuer'] = false
@@ -313,10 +315,15 @@ def parse_file(doc)
313315
@host_results[address]['insecure_renegotiation'] = true
314316
end
315317

316-
if results['breach']['severity'] == "OK"
318+
#Need to wrap this as not all output has this issue present in the file.
319+
begin
320+
if results['breach']['severity'] == "OK"
321+
@host_results[address]['compression'] = false
322+
else
323+
@host_results[address]['compression'] = true
324+
end
325+
rescue NoMethodError
317326
@host_results[address]['compression'] = false
318-
else
319-
@host_results[address]['compression'] = true
320327
end
321328

322329
if results['ccs']['severity'] == "OK"
@@ -346,57 +353,61 @@ def excel_report
346353
cert_sheet.sheet_name = "Certificate Issues"
347354
cert_sheet.add_cell(0,0,"IP Address")
348355
cert_sheet.add_cell(0,1,"Hostname")
349-
cert_sheet.add_cell(0,2,"Self Signed Certificate?")
350-
cert_sheet.add_cell(0,3,"Untrusted Issuer?")
351-
cert_sheet.add_cell(0,4,"Subject Mismatch with Hostname?")
352-
cert_sheet.add_cell(0,5,"Certificate without WWW?")
353-
cert_sheet.add_cell(0,6,"Expired Certificate?")
354-
cert_sheet.add_cell(0,7,"Certificate Expiry Imminent?")
355-
cert_sheet.add_cell(0,8,"Wildcard Certificate?")
356-
cert_sheet.add_cell(0,9,"Small Public Key")
356+
cert_sheet.add_cell(0,2,"port")
357+
cert_sheet.add_cell(0,3,"Self Signed Certificate?")
358+
cert_sheet.add_cell(0,4,"Untrusted Issuer?")
359+
cert_sheet.add_cell(0,5,"Subject Mismatch with Hostname?")
360+
cert_sheet.add_cell(0,6,"Certificate without WWW?")
361+
cert_sheet.add_cell(0,7,"Expired Certificate?")
362+
cert_sheet.add_cell(0,8,"Certificate Expiry Imminent?")
363+
cert_sheet.add_cell(0,9,"Wildcard Certificate?")
364+
cert_sheet.add_cell(0,10,"Small Public Key")
357365
#cert_sheet.add_cell(0,9,"Certificate Revoked?")
358-
cert_sheet.add_cell(0,10,"Certificate Signature SHA-1")
366+
cert_sheet.add_cell(0,11,"Certificate Signature SHA-1")
359367

360368
cipher_sheet = workbook.add_worksheet('Cipher Issues')
361369
cipher_sheet.add_cell(0,0,"IP Address")
362370
cipher_sheet.add_cell(0,1,"Hostname")
363-
cipher_sheet.add_cell(0,2,"Anonymous Ciphers Supported")
364-
cipher_sheet.add_cell(0,3,"Weak Ciphers Supported")
365-
cipher_sheet.add_cell(0,4,"RC4 Ciphers Supported")
366-
cipher_sheet.add_cell(0,5,"Weak Diffie-hellman")
367-
cipher_sheet.add_cell(0,6,"Weak RSA Key Exchange")
368-
cipher_sheet.add_cell(0,7,"Forward Secrecy Unsupported")
371+
cipher_sheet.add_cell(0,2,"port")
372+
cipher_sheet.add_cell(0,3,"Anonymous Ciphers Supported")
373+
cipher_sheet.add_cell(0,4,"Weak Ciphers Supported")
374+
cipher_sheet.add_cell(0,5,"RC4 Ciphers Supported")
375+
cipher_sheet.add_cell(0,6,"Weak Diffie-hellman")
376+
cipher_sheet.add_cell(0,7,"Weak RSA Key Exchange")
377+
cipher_sheet.add_cell(0,8,"Forward Secrecy Unsupported")
369378

370379
protocol_sheet = workbook.add_worksheet('Protocol Issues')
371380
protocol_sheet.add_cell(0,0,"IP Address")
372381
protocol_sheet.add_cell(0,1,"Hostname")
373-
protocol_sheet.add_cell(0,2,"SSLv2 Supported")
374-
protocol_sheet.add_cell(0,3,"SSLv3 Supported")
382+
protocol_sheet.add_cell(0,2,"port")
383+
protocol_sheet.add_cell(0,3,"SSLv2 Supported")
384+
protocol_sheet.add_cell(0,4,"SSLv3 Supported")
375385
#protocol_sheet.add_cell(0,3,"Poodle over TLS")
376-
protocol_sheet.add_cell(0,4,"No support for TLS above 1.0")
377-
protocol_sheet.add_cell(0,5,"Client-Initiated Renogotiation DoS")
378-
protocol_sheet.add_cell(0,6,"Insecure Renogotiation")
379-
protocol_sheet.add_cell(0,7,"Compression Supported")
380-
protocol_sheet.add_cell(0,8,"OpenSSL ChangeCipherSpec (CCS) Vulnerability")
381-
protocol_sheet.add_cell(0,9,"BEAST")
386+
protocol_sheet.add_cell(0,5,"No support for TLS above 1.0")
387+
protocol_sheet.add_cell(0,6,"Client-Initiated Renogotiation DoS")
388+
protocol_sheet.add_cell(0,7,"Insecure Renogotiation")
389+
protocol_sheet.add_cell(0,8,"Compression Supported")
390+
protocol_sheet.add_cell(0,9,"OpenSSL ChangeCipherSpec (CCS) Vulnerability")
391+
protocol_sheet.add_cell(0,10,"BEAST")
382392

383393
row_count = 1
384394
@host_results.each do |host, vulns|
385395
host_name = host.split(':')[0]
386396
cert_sheet.add_cell(row_count,0,host.split('/')[1])
387397
cert_sheet.add_cell(row_count,1,host.split('/')[0])
388-
cert_sheet.add_cell(row_count,2,vulns['self_signed'])
389-
cert_sheet.add_cell(row_count,3,vulns['untrusted_issuer'])
390-
cert_sheet.add_cell(row_count,4,vulns['hostname_mismatch'])
391-
cert_sheet.add_cell(row_count,5,vulns['cert_no_www'])
392-
cert_sheet.add_cell(row_count,6,vulns['expired_cert'])
393-
cert_sheet.add_cell(row_count,7,vulns['cert_expiring_soon'])
394-
cert_sheet.add_cell(row_count,8,vulns['wildcard_cert'])
395-
cert_sheet.add_cell(row_count,9,vulns['public_key_size'])
398+
cert_sheet.add_cell(row_count,2,vulns['port'])
399+
cert_sheet.add_cell(row_count,3,vulns['self_signed'])
400+
cert_sheet.add_cell(row_count,4,vulns['untrusted_issuer'])
401+
cert_sheet.add_cell(row_count,5,vulns['hostname_mismatch'])
402+
cert_sheet.add_cell(row_count,6,vulns['cert_no_www'])
403+
cert_sheet.add_cell(row_count,7,vulns['expired_cert'])
404+
cert_sheet.add_cell(row_count,8,vulns['cert_expiring_soon'])
405+
cert_sheet.add_cell(row_count,9,vulns['wildcard_cert'])
406+
cert_sheet.add_cell(row_count,10,vulns['public_key_size'])
396407
#cert_sheet.add_cell(row_count,9,"Not Tested")
397-
cert_sheet.add_cell(row_count,10,vulns['sha1_signed'])
408+
cert_sheet.add_cell(row_count,11,vulns['sha1_signed'])
398409
#Apply Colours
399-
col = 2
410+
col = 3
400411
#number of cols to colour in
401412
9.times do |i|
402413
if cert_sheet.sheet_data[row_count][col + i].value == true
@@ -408,14 +419,15 @@ def excel_report
408419

409420
cipher_sheet.add_cell(row_count,0,host.split('/')[1])
410421
cipher_sheet.add_cell(row_count,1,host.split('/')[0])
411-
cipher_sheet.add_cell(row_count,2,vulns['anonymous_ciphers'])
412-
cipher_sheet.add_cell(row_count,3,vulns['weak_ciphers'])
413-
cipher_sheet.add_cell(row_count,4,vulns['rc4_ciphers'])
414-
cipher_sheet.add_cell(row_count,5,vulns['weak_dh'])
415-
cipher_sheet.add_cell(row_count,6,vulns['weak_rsa'])
416-
cipher_sheet.add_cell(row_count,7,vulns['no_pfs'])
417-
418-
col = 2
422+
cipher_sheet.add_cell(row_count,2,vulns['port'])
423+
cipher_sheet.add_cell(row_count,3,vulns['anonymous_ciphers'])
424+
cipher_sheet.add_cell(row_count,4,vulns['weak_ciphers'])
425+
cipher_sheet.add_cell(row_count,5,vulns['rc4_ciphers'])
426+
cipher_sheet.add_cell(row_count,6,vulns['weak_dh'])
427+
cipher_sheet.add_cell(row_count,7,vulns['weak_rsa'])
428+
cipher_sheet.add_cell(row_count,8,vulns['no_pfs'])
429+
430+
col = 3
419431
6.times do |i|
420432
if cipher_sheet.sheet_data[row_count][col + i].value == true
421433
cipher_sheet.sheet_data[row_count][col + i].change_fill('d4004b')
@@ -426,17 +438,19 @@ def excel_report
426438

427439
protocol_sheet.add_cell(row_count,0,host.split('/')[1])
428440
protocol_sheet.add_cell(row_count,1,host.split('/')[0])
429-
protocol_sheet.add_cell(row_count,2,vulns['sslv2_supported'])
430-
protocol_sheet.add_cell(row_count,3,vulns['sslv3_supported'])
441+
protocol_sheet.add_cell(row_count,2,vulns['port'])
442+
protocol_sheet.add_cell(row_count,3,vulns['sslv2_supported'])
443+
protocol_sheet.add_cell(row_count,4,vulns['sslv3_supported'])
431444
#POODLE over TLS , probably not worth specifically sorting this unless sslyze does
432445
#protocol_sheet.add_cell(row_count,3,"Not Tested")
433-
protocol_sheet.add_cell(row_count,4,vulns['no_tls_v1_1_2'])
434-
protocol_sheet.add_cell(row_count,5,vulns['client_renegotiation'])
435-
protocol_sheet.add_cell(row_count,6,vulns['insecure_renegotiation'])
436-
protocol_sheet.add_cell(row_count,7,vulns['compression'])
437-
protocol_sheet.add_cell(row_count,8,vulns['ccs_vuln'])
438-
protocol_sheet.add_cell(row_count,9,vulns['beast'])
446+
protocol_sheet.add_cell(row_count,5,vulns['no_tls_v1_1_2'])
447+
protocol_sheet.add_cell(row_count,6,vulns['client_renegotiation'])
448+
protocol_sheet.add_cell(row_count,7,vulns['insecure_renegotiation'])
449+
protocol_sheet.add_cell(row_count,8,vulns['compression'])
450+
protocol_sheet.add_cell(row_count,9,vulns['ccs_vuln'])
451+
protocol_sheet.add_cell(row_count,10,vulns['beast'])
439452
#Add the colours
453+
col = 3
440454
8.times do |i|
441455
if protocol_sheet.sheet_data[row_count][col + i].value == true
442456
protocol_sheet.sheet_data[row_count][col + i].change_fill('d4004b')

0 commit comments

Comments
 (0)