diff --git a/lib/common/common_helper.rb b/lib/common/common_helper.rb index 5a20182f..52743852 100644 --- a/lib/common/common_helper.rb +++ b/lib/common/common_helper.rb @@ -95,31 +95,13 @@ def version REVISION ? "v#{WPSCAN_VERSION}r#{REVISION}" : "v#{WPSCAN_VERSION}" end -# our 1337 banner -def banner - puts '_______________________________________________________________' - puts ' __ _______ _____ ' - puts ' \\ \\ / / __ \\ / ____| ' - puts ' \\ \\ /\\ / /| |__) | (___ ___ __ _ _ __ ' - puts ' \\ \\/ \\/ / | ___/ \\___ \\ / __|/ _` | \'_ \\ ' - puts ' \\ /\\ / | | ____) | (__| (_| | | | |' - puts ' \\/ \\/ |_| |_____/ \\___|\\__,_|_| |_|' - puts - puts bold(' WordPress Security Scanner by the WPScan Team ') - # Alignment of the version (w & w/o the Revision) - if REVISION - puts " Version #{version}" - else - puts " Version #{version}" - end - puts ' Sponsored by the RandomStorm Open Source Initiative' - puts ' @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_' - puts '_______________________________________________________________' - puts -end - +# Define colors def colorize(text, color_code) - "\e[#{color_code}m#{text}\e[0m" + if $COLORSWITCH + "#{text}" + else + "\e[#{color_code}m#{text}\e[0m" + end end def bold(text) @@ -142,6 +124,29 @@ def blue(text) colorize(text, 34) end +# our 1337 banner +def banner + puts '_______________________________________________________________' + puts ' __ _______ _____ ' + puts ' \\ \\ / / __ \\ / ____| ' + puts ' \\ \\ /\\ / /| |__) | (___ ___ __ _ _ __ ' + puts ' \\ \\/ \\/ / | ___/ \\___ \\ / __|/ _` | \'_ \\ ' + puts ' \\ /\\ / | | ____) | (__| (_| | | | |' + puts ' \\/ \\/ |_| |_____/ \\___|\\__,_|_| |_|' + puts + puts ' WordPress Security Scanner by the WPScan Team ' + # Alignment of the version (w & w/o the Revision) + if REVISION + puts " Version #{version}" + else + puts " Version #{version}" + end + puts ' Sponsored by the RandomStorm Open Source Initiative' + puts ' @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_' + puts '_______________________________________________________________' + puts +end + def xml(file) Nokogiri::XML(File.open(file)) do |config| config.noblanks diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index 4a58e350..1ed0e686 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -13,6 +13,7 @@ class WpscanOptions :enumerate_timthumbs, :enumerate_usernames, :enumerate_usernames_range, + :no_color, :proxy, :proxy_auth, :threads, @@ -257,7 +258,8 @@ class WpscanOptions ['--request-timeout', GetoptLong::REQUIRED_ARGUMENT], ['--connect-timeout', GetoptLong::REQUIRED_ARGUMENT], ['--max-threads', GetoptLong::REQUIRED_ARGUMENT], - ['--batch', GetoptLong::NO_ARGUMENT] + ['--batch', GetoptLong::NO_ARGUMENT], + ['--no-color', GetoptLong::NO_ARGUMENT] ) end diff --git a/wpscan.rb b/wpscan.rb index c9cf05f5..fbe49884 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -18,6 +18,9 @@ def main raise('No argument supplied') end + # Define a global variable + $COLORSWITCH = wpscan_options.no_color + if wpscan_options.help help() usage()