From adfd26eb2ddc4309a1813e76f760025fc2e06922 Mon Sep 17 00:00:00 2001 From: David Maloney Date: Mon, 11 Feb 2013 17:08:14 -0600 Subject: [PATCH] Cleanup to_s output --- lib/rex.rb | 4 ++++ lib/rex/sslscan/result.rb | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/rex.rb b/lib/rex.rb index adc93d2535..7a08e4ea8f 100644 --- a/lib/rex.rb +++ b/lib/rex.rb @@ -88,6 +88,10 @@ require 'rex/compat' # Platforms require 'rex/platforms' +#SSLScan +require 'rex/sslscan/scanner' +require 'rex/sslscan/result' + # Overload the Kernel.sleep() function to be thread-safe Kernel.class_eval(" diff --git a/lib/rex/sslscan/result.rb b/lib/rex/sslscan/result.rb index 9a3b59e39e..9dee8c0048 100644 --- a/lib/rex/sslscan/result.rb +++ b/lib/rex/sslscan/result.rb @@ -164,7 +164,8 @@ class Result table = Rex::Ui::Text::Table.new( 'Header' => 'SSL Ciphers', 'Indent' => 1, - 'Columns' => ['Status', 'Weak', 'SSL Version', 'Key Length', 'Cipher'] + 'Columns' => ['Status', 'Weak', 'SSL Version', 'Key Length', 'Cipher'], + 'SortIndex' => -1 ) ciphers.each do |cipher| if cipher[:weak] @@ -172,8 +173,11 @@ class Result else weak = ' ' end - table << [cipher[:status], weak , cipher[:version], cipher[:key_length], cipher[:cipher]] + table << [cipher[:status].to_s.capitalize, weak , cipher[:version], cipher[:key_length], cipher[:cipher]] end + + # Sort by SSL Version, then Key Length, and then Status + table.rows.sort_by!{|row| [row[0],row[2],row[3]]} text = "#{table.to_s}" if @cert text <<" \n\n #{@cert.to_text}"