@@ -148,6 +148,7 @@ def parse_files
148
148
def parse_file ( doc )
149
149
address = doc [ 0 ] [ 'ip' ]
150
150
@host_results [ address ] = Hash . new
151
+
151
152
152
153
153
154
#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)
161
162
host_names << sans . split ( ' ' )
162
163
host_names << address . split ( '/' ) [ 0 ]
163
164
165
+ @host_results [ address ] [ 'port' ] = results [ 'service' ] [ 'port' ]
164
166
165
167
#Self Signed Certificate Checks
166
- if results [ 'trust ' ] [ 'finding' ] . downcase =~ /self signed/
168
+ if results [ 'chain_of_trust ' ] [ 'finding' ] . downcase =~ /self signed/
167
169
@host_results [ address ] [ 'self_signed' ] = true
168
170
else
169
171
@host_results [ address ] [ 'self_signed' ] = false
170
172
end
171
173
172
174
#Untrusted Issuer
173
- if results [ 'trust ' ] [ 'finding' ] . downcase =~ /chain incomplete /
175
+ if results [ 'chain_of_trust ' ] [ 'finding' ] . downcase =~ /all certificate trust checks failed /
174
176
@host_results [ address ] [ 'untrusted_issuer' ] = true
175
177
else
176
178
@host_results [ address ] [ 'untrusted_issuer' ] = false
@@ -313,10 +315,15 @@ def parse_file(doc)
313
315
@host_results [ address ] [ 'insecure_renegotiation' ] = true
314
316
end
315
317
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
317
326
@host_results [ address ] [ 'compression' ] = false
318
- else
319
- @host_results [ address ] [ 'compression' ] = true
320
327
end
321
328
322
329
if results [ 'ccs' ] [ 'severity' ] == "OK"
@@ -346,57 +353,61 @@ def excel_report
346
353
cert_sheet . sheet_name = "Certificate Issues"
347
354
cert_sheet . add_cell ( 0 , 0 , "IP Address" )
348
355
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" )
357
365
#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" )
359
367
360
368
cipher_sheet = workbook . add_worksheet ( 'Cipher Issues' )
361
369
cipher_sheet . add_cell ( 0 , 0 , "IP Address" )
362
370
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" )
369
378
370
379
protocol_sheet = workbook . add_worksheet ( 'Protocol Issues' )
371
380
protocol_sheet . add_cell ( 0 , 0 , "IP Address" )
372
381
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" )
375
385
#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" )
382
392
383
393
row_count = 1
384
394
@host_results . each do |host , vulns |
385
395
host_name = host . split ( ':' ) [ 0 ]
386
396
cert_sheet . add_cell ( row_count , 0 , host . split ( '/' ) [ 1 ] )
387
397
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' ] )
396
407
#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' ] )
398
409
#Apply Colours
399
- col = 2
410
+ col = 3
400
411
#number of cols to colour in
401
412
9 . times do |i |
402
413
if cert_sheet . sheet_data [ row_count ] [ col + i ] . value == true
@@ -408,14 +419,15 @@ def excel_report
408
419
409
420
cipher_sheet . add_cell ( row_count , 0 , host . split ( '/' ) [ 1 ] )
410
421
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
419
431
6 . times do |i |
420
432
if cipher_sheet . sheet_data [ row_count ] [ col + i ] . value == true
421
433
cipher_sheet . sheet_data [ row_count ] [ col + i ] . change_fill ( 'd4004b' )
@@ -426,17 +438,19 @@ def excel_report
426
438
427
439
protocol_sheet . add_cell ( row_count , 0 , host . split ( '/' ) [ 1 ] )
428
440
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' ] )
431
444
#POODLE over TLS , probably not worth specifically sorting this unless sslyze does
432
445
#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' ] )
439
452
#Add the colours
453
+ col = 3
440
454
8 . times do |i |
441
455
if protocol_sheet . sheet_data [ row_count ] [ col + i ] . value == true
442
456
protocol_sheet . sheet_data [ row_count ] [ col + i ] . change_fill ( 'd4004b' )
0 commit comments