@@ -429,6 +429,22 @@ def initialize(info = {})
429
429
] , self . class )
430
430
end
431
431
432
+ def report_good ( line )
433
+ print_good line
434
+ end
435
+
436
+ def report_warning ( line )
437
+ print_warning line
438
+ end
439
+
440
+ def report_bad ( line )
441
+ print_warning line
442
+ end
443
+
444
+ def report_status ( line )
445
+ print_status line
446
+ end
447
+
432
448
def output_endpoint_data ( r )
433
449
ssl_protocols = [
434
450
{ id : 771 , name : "TLS" , version : "1.2" , secure : true , active : false } ,
@@ -438,21 +454,21 @@ def output_endpoint_data(r)
438
454
{ id : 2 , name : "SSL" , version : "2.0" , secure : false , active : false }
439
455
]
440
456
441
- print_status "-----------------------------------------------------------------"
442
- print_status "Report for #{ r . server_name } (#{ r . ip_address } )"
443
- print_status "-----------------------------------------------------------------"
457
+ report_status "-----------------------------------------------------------------"
458
+ report_status "Report for #{ r . server_name } (#{ r . ip_address } )"
459
+ report_status "-----------------------------------------------------------------"
444
460
445
461
case r . grade . to_s
446
462
when "A+" , "A" , "A-"
447
- print_good "Overal rating: #{ r . grade } "
463
+ report_good "Overall rating: #{ r . grade } "
448
464
when "B"
449
- print_warning "Overal rating: #{ r . grade } "
465
+ report_warning "Overall rating: #{ r . grade } "
450
466
when "C" , "D" , "E" , "F"
451
- print_error "Overal rating: #{ r . grade } "
467
+ report_bad "Overall rating: #{ r . grade } "
452
468
when "M"
453
- print_error "Overal rating: #{ r . grade } - Certificate name mismatch"
469
+ report_bad "Overall rating: #{ r . grade } - Certificate name mismatch"
454
470
when "T"
455
- print_error "Overal rating: #{ r . grade } - Server's certificate is not trusted"
471
+ report_bad "Overall rating: #{ r . grade } - Server's certificate is not trusted"
456
472
end
457
473
458
474
# Supported protocols
@@ -464,105 +480,105 @@ def output_endpoint_data(r)
464
480
ssl_protocols . each do |proto |
465
481
if proto [ :active ]
466
482
if proto [ :secure ]
467
- print_good "#{ proto [ :name ] } #{ proto [ :version ] } - Yes"
483
+ report_good "#{ proto [ :name ] } #{ proto [ :version ] } - Yes"
468
484
else
469
- print_error "#{ proto [ :name ] } #{ proto [ :version ] } - Yes"
485
+ report_bad "#{ proto [ :name ] } #{ proto [ :version ] } - Yes"
470
486
end
471
487
else
472
- print_status "#{ proto [ :name ] } #{ proto [ :version ] } - No"
488
+ report_good "#{ proto [ :name ] } #{ proto [ :version ] } - No"
473
489
end
474
490
end
475
491
476
492
# Renegotioation
477
493
case
478
494
when r . details . reneg_support == 0
479
- print_warning "Secure renegotiation is not supported"
495
+ report_warning "Secure renegotiation is not supported"
480
496
when r . details . reneg_support [ 0 ] == 1
481
- print_error "Insecure client-initiated renegotiation is supported"
497
+ report_bad "Insecure client-initiated renegotiation is supported"
482
498
when r . details . reneg_support [ 1 ] == 1
483
- print_good "Secure renegotiation is supported"
499
+ report_good "Secure renegotiation is supported"
484
500
when r . details . reneg_support [ 2 ] == 1
485
- print_warning "Secure client-initiated renegotiation is supported"
501
+ report_warning "Secure client-initiated renegotiation is supported"
486
502
when r . details . reneg_support [ 3 ] == 1
487
- print_warning "Server requires secure renegotiation support"
503
+ report_warning "Server requires secure renegotiation support"
488
504
end
489
505
490
506
# BEAST
491
507
if r . details . vuln_beast?
492
- print_error "BEAST attack - Yes"
508
+ report_bad "BEAST attack - Yes"
493
509
else
494
- print_good "BEAST attack - No"
510
+ report_good "BEAST attack - No"
495
511
end
496
512
497
513
# puts "POODLE (SSLv3)- ?"
498
514
499
515
# POODLE TLS
500
516
case r . details . poodle_tls
501
517
when -1
502
- print_warning "POODLE TLS - Test failed"
518
+ report_warning "POODLE TLS - Test failed"
503
519
when 0
504
- print_warning "POODLE TLS - Unknown"
520
+ report_warning "POODLE TLS - Unknown"
505
521
when 1
506
- print_good "POODLE TLS - No"
522
+ report_good "POODLE TLS - No"
507
523
when 2
508
- print_error "POODLE TLS - Yes"
524
+ report_bad "POODLE TLS - Yes"
509
525
end
510
526
511
527
# Downgrade attack prevention
512
528
if r . details . fallback_scsv?
513
- print_good "Downgrade attack prevention - Yes"
529
+ report_good "Downgrade attack prevention - Yes"
514
530
else
515
- print_error "Downgrade attack prevention - No"
531
+ report_bad "Downgrade attack prevention - No"
516
532
end
517
533
518
534
# RC4
519
535
if r . details . supports_rc4?
520
- print_warning "RC4 - Server supports at least one RC4 suite"
536
+ report_warning "RC4 - Server supports at least one RC4 suite"
521
537
else
522
- print_good "RC4 - No"
538
+ report_good "RC4 - No"
523
539
end
524
540
525
541
# RC4 with modern browsers
526
- print_warning "RC4 is used with modern clients" if r . details . rc4_with_modern?
542
+ report_warning "RC4 is used with modern clients" if r . details . rc4_with_modern?
527
543
528
544
# Heartbeat
529
545
if r . details . heartbeat?
530
- print_status "Heartbeat (extension) - Yes"
546
+ report_status "Heartbeat (extension) - Yes"
531
547
else
532
- print_status "Heartbeat (extension) - No"
548
+ report_status "Heartbeat (extension) - No"
533
549
end
534
550
535
551
# Heartbleed
536
552
if r . details . heartbleed?
537
- print_error "Heartbleed (vulnerability) - Yes"
553
+ report_bad "Heartbleed (vulnerability) - Yes"
538
554
else
539
- print_good "Heartbeat (vulnerability) - No"
555
+ report_good "Heartbeat (vulnerability) - No"
540
556
end
541
557
542
558
# OpenSSL CCS
543
559
case r . details . open_ssl_ccs
544
560
when -1
545
- print_warning "OpenSSL CCS vulnerability (CVE-2014-0224) - Test failed"
561
+ report_warning "OpenSSL CCS vulnerability (CVE-2014-0224) - Test failed"
546
562
when 0
547
- print_warning "OpenSSL CCS vulnerability (CVE-2014-0224) - Unknown"
563
+ report_warning "OpenSSL CCS vulnerability (CVE-2014-0224) - Unknown"
548
564
when 1
549
- print_good "OpenSSL CCS vulnerability (CVE-2014-0224) - No"
565
+ report_good "OpenSSL CCS vulnerability (CVE-2014-0224) - No"
550
566
when 2
551
- print_error "OpenSSL CCS vulnerability (CVE-2014-0224) - Possibly vulnerable, but not exploitable"
567
+ report_bad "OpenSSL CCS vulnerability (CVE-2014-0224) - Possibly vulnerable, but not exploitable"
552
568
when 3
553
- print_error "OpenSSL CCS vulnerability (CVE-2014-0224) - Vulnerable and exploitable"
569
+ report_bad "OpenSSL CCS vulnerability (CVE-2014-0224) - Vulnerable and exploitable"
554
570
end
555
571
556
572
# Forward Secrecy
557
573
case
558
574
when r . details . forward_secrecy == 0
559
- print_error "Forward Secrecy - No"
575
+ report_bad "Forward Secrecy - No"
560
576
when r . details . forward_secrecy [ 0 ] == 1
561
- print_error "Forward Secrecy - With some browsers"
577
+ report_bad "Forward Secrecy - With some browsers"
562
578
when r . details . forward_secrecy [ 1 ] == 1
563
- print_good "Forward Secrecy - With modern browsers"
579
+ report_good "Forward Secrecy - With modern browsers"
564
580
when r . details . forward_secrecy [ 2 ] == 1
565
- print_good "Forward Secrecy - Yes (with most browsers)"
581
+ report_good "Forward Secrecy - Yes (with most browsers)"
566
582
end
567
583
568
584
# HSTS
@@ -572,31 +588,31 @@ def output_endpoint_data(r)
572
588
str += ":max-age=#{ r . details . sts_max_age } "
573
589
end
574
590
str += ":includeSubdomains" if r . details . sts_subdomains?
575
- print_good str
591
+ report_good str
576
592
else
577
- print_error "Strict Transport Security (HSTS) - No"
593
+ report_bad "Strict Transport Security (HSTS) - No"
578
594
end
579
595
580
596
# HPKP
581
597
if r . details . pkp_response_header
582
- print_good "Public Key Pinning (HPKP) - Yes"
598
+ report_good "Public Key Pinning (HPKP) - Yes"
583
599
else
584
- print_warning "Public Key Pinning (HPKP) - No"
600
+ report_warning "Public Key Pinning (HPKP) - No"
585
601
end
586
602
587
603
# Compression
588
604
if r . details . compression_methods == 0
589
- print_good "Compression - No"
605
+ report_good "Compression - No"
590
606
elsif ( r . details . session_tickets & 1 ) != 0
591
- print_warning "Compression - Yes (Deflate)"
607
+ report_warning "Compression - Yes (Deflate)"
592
608
end
593
609
594
610
# Session Resumption
595
611
case r . details . session_resumption
596
612
when 0
597
613
print_status "Session resumption - No"
598
614
when 1
599
- print_warning "Session resumption - No (IDs assigned but not accepted)"
615
+ report_warning "Session resumption - No (IDs assigned but not accepted)"
600
616
when 2
601
617
print_status "Session resumption - Yes"
602
618
end
@@ -608,9 +624,9 @@ def output_endpoint_data(r)
608
624
when r . details . session_tickets [ 0 ] == 1
609
625
print_status "Session tickets - Yes"
610
626
when r . details . session_tickets [ 1 ] == 1
611
- print_good "Session tickets - Implementation is faulty"
627
+ report_good "Session tickets - Implementation is faulty"
612
628
when r . details . session_tickets [ 2 ] == 1
613
- print_warning "Session tickets - Server is intolerant to the extension"
629
+ report_warning "Session tickets - Server is intolerant to the extension"
614
630
end
615
631
616
632
# OCSP stapling
0 commit comments