Added a --no-color argument switch

This commit is contained in:
Peter
2014-05-02 14:43:16 +02:00
parent 2104b49cee
commit b349990b19
3 changed files with 35 additions and 25 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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()