add --version switch

This commit is contained in:
Christian Mehlmauer
2013-08-18 15:40:55 +02:00
parent 81f9612de2
commit 03f8b02ac1
3 changed files with 18 additions and 4 deletions

View File

@@ -78,6 +78,13 @@ else
REVISION = nil
end
def version
if REVISION
return "v#{WPSCAN_VERSION}r#{REVISION}"
end
return "v#{WPSCAN_VERSION}"
end
# our 1337 banner
def banner
puts '_______________________________________________________________'
@@ -90,9 +97,9 @@ def banner
puts
puts ' WordPress Security Scanner by the WPScan Team '
if REVISION
puts " Version v#{WPSCAN_VERSION}r#{REVISION}"
puts " Version #{version}"
else
puts " Version v#{WPSCAN_VERSION}"
puts " Version #{version}"
end
puts ' Sponsored by the RandomStorm Open Source Initiative'
puts ' @_WPScan_, @ethicalhack3r, @erwan_lr, @gbrindisi, @_FireFart_'

View File

@@ -29,7 +29,8 @@ class WpscanOptions
:config_file,
:exclude_content_based,
:basic_auth,
:debug_output
:debug_output,
:version
]
attr_accessor *ACCESSOR_OPTIONS
@@ -237,7 +238,8 @@ class WpscanOptions
['--config-file', '-c', GetoptLong::REQUIRED_ARGUMENT],
['--exclude-content-based', GetoptLong::REQUIRED_ARGUMENT],
['--basic-auth', GetoptLong::REQUIRED_ARGUMENT],
['--debug-output', GetoptLong::NO_ARGUMENT]
['--debug-output', GetoptLong::NO_ARGUMENT],
['--version', GetoptLong::NO_ARGUMENT]
)
end

View File

@@ -24,6 +24,11 @@ def main
exit(0)
end
if wpscan_options.version
puts "Current version is #{version}"
exit(0)
end
# Check for updates
if wpscan_options.update
if !@updater.nil?