Move spacer to a function
This commit is contained in:
@@ -191,6 +191,11 @@ def banner
|
|||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Space out sections
|
||||||
|
def spacer
|
||||||
|
puts " - - - - -"
|
||||||
|
end
|
||||||
|
|
||||||
def xml(file)
|
def xml(file)
|
||||||
Nokogiri::XML(File.open(file)) do |config|
|
Nokogiri::XML(File.open(file)) do |config|
|
||||||
config.noblanks
|
config.noblanks
|
||||||
|
|||||||
48
wpscan.rb
48
wpscan.rb
@@ -233,7 +233,7 @@ def main
|
|||||||
puts info("URL: #{wp_target.url}")
|
puts info("URL: #{wp_target.url}")
|
||||||
puts info("Started: #{start_time.asctime}")
|
puts info("Started: #{start_time.asctime}")
|
||||||
puts info("User-Agent: #{wpscan_options.user_agent}") if wpscan_options.verbose and wpscan_options.user_agent
|
puts info("User-Agent: #{wpscan_options.user_agent}") if wpscan_options.verbose and wpscan_options.user_agent
|
||||||
puts
|
spacer()
|
||||||
|
|
||||||
wp_target.interesting_headers.each do |header|
|
wp_target.interesting_headers.each do |header|
|
||||||
output = info('Interesting header: ')
|
output = info('Interesting header: ')
|
||||||
@@ -245,8 +245,8 @@ def main
|
|||||||
else
|
else
|
||||||
puts output + "#{header[0]}: #{header[1]}"
|
puts output + "#{header[0]}: #{header[1]}"
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
|
||||||
end
|
end
|
||||||
|
spacer()
|
||||||
|
|
||||||
if wp_target.has_robots?
|
if wp_target.has_robots?
|
||||||
puts info("robots.txt available under: #{wp_target.robots_url}")
|
puts info("robots.txt available under: #{wp_target.robots_url}")
|
||||||
@@ -254,7 +254,7 @@ def main
|
|||||||
wp_target.parse_robots_txt.each do |dir|
|
wp_target.parse_robots_txt.each do |dir|
|
||||||
puts info("Interesting entry from robots.txt: #{dir}")
|
puts info("Interesting entry from robots.txt: #{dir}")
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_humans?
|
if wp_target.has_humans?
|
||||||
@@ -263,7 +263,7 @@ def main
|
|||||||
wp_target.parse_humans_txt.each do |dir|
|
wp_target.parse_humans_txt.each do |dir|
|
||||||
puts info("Interesting entry from humans.txt: #{dir}")
|
puts info("Interesting entry from humans.txt: #{dir}")
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_security?
|
if wp_target.has_security?
|
||||||
@@ -272,42 +272,42 @@ def main
|
|||||||
wp_target.parse_security_txt.each do |dir|
|
wp_target.parse_security_txt.each do |dir|
|
||||||
puts info("Interesting entry from security.txt: #{dir}")
|
puts info("Interesting entry from security.txt: #{dir}")
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_debug_log?
|
if wp_target.has_debug_log?
|
||||||
puts critical("Debug log file found: #{wp_target.debug_log_url}")
|
puts critical("Debug log file found: #{wp_target.debug_log_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
wp_target.config_backup.each do |file_url|
|
wp_target.config_backup.each do |file_url|
|
||||||
puts critical("A wp-config.php backup file has been found in: #{file_url}")
|
puts critical("A wp-config.php backup file has been found in: #{file_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.search_replace_db_2_exists?
|
if wp_target.search_replace_db_2_exists?
|
||||||
puts critical("searchreplacedb2.php has been found in: #{wp_target.search_replace_db_2_url}")
|
puts critical("searchreplacedb2.php has been found in: #{wp_target.search_replace_db_2_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.emergency_exists?
|
if wp_target.emergency_exists?
|
||||||
puts critical("emergency.php has been found in: #{wp_target.emergency_url}")
|
puts critical("emergency.php has been found in: #{wp_target.emergency_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.multisite?
|
if wp_target.multisite?
|
||||||
puts info('This site seems to be a multisite (http://codex.wordpress.org/Glossary#Multisite)')
|
puts info('This site seems to be a multisite (http://codex.wordpress.org/Glossary#Multisite)')
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_must_use_plugins?
|
if wp_target.has_must_use_plugins?
|
||||||
puts info("This site has 'Must Use Plugins' (http://codex.wordpress.org/Must_Use_Plugins)")
|
puts info("This site has 'Must Use Plugins' (http://codex.wordpress.org/Must_Use_Plugins)")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_xml_rpc?
|
if wp_target.has_xml_rpc?
|
||||||
puts info("XML-RPC Interface available under: #{wp_target.xml_rpc_url}")
|
puts info("XML-RPC Interface available under: #{wp_target.xml_rpc_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_api?(wp_target.json_url)
|
if wp_target.has_api?(wp_target.json_url)
|
||||||
@@ -319,22 +319,22 @@ def main
|
|||||||
# Print users from JSON
|
# Print users from JSON
|
||||||
wp_target.json_get_users(wp_target.json_users_url)
|
wp_target.json_get_users(wp_target.json_users_url)
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.has_full_path_disclosure?
|
if wp_target.has_full_path_disclosure?
|
||||||
puts warning("Full Path Disclosure (FPD) in '#{wp_target.full_path_disclosure_url}': #{wp_target.full_path_disclosure_data}")
|
puts warning("Full Path Disclosure (FPD) in '#{wp_target.full_path_disclosure_url}': #{wp_target.full_path_disclosure_data}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.upload_directory_listing_enabled?
|
if wp_target.upload_directory_listing_enabled?
|
||||||
puts warning("Upload directory has directory listing enabled: #{wp_target.upload_dir_url}")
|
puts warning("Upload directory has directory listing enabled: #{wp_target.upload_dir_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_target.include_directory_listing_enabled?
|
if wp_target.include_directory_listing_enabled?
|
||||||
puts warning("Includes directory has directory listing enabled: #{wp_target.includes_dir_url}")
|
puts warning("Includes directory has directory listing enabled: #{wp_target.includes_dir_url}")
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
enum_options = {
|
enum_options = {
|
||||||
@@ -352,7 +352,7 @@ def main
|
|||||||
puts
|
puts
|
||||||
puts notice('WordPress version can not be detected')
|
puts notice('WordPress version can not be detected')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
|
|
||||||
if wp_theme = wp_target.theme
|
if wp_theme = wp_target.theme
|
||||||
puts
|
puts
|
||||||
@@ -371,7 +371,7 @@ def main
|
|||||||
parent.output(wpscan_options.verbose)
|
parent.output(wpscan_options.verbose)
|
||||||
wp_theme = parent
|
wp_theme = parent
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wpscan_options.enumerate_plugins == nil and wpscan_options.enumerate_only_vulnerable_plugins == nil
|
if wpscan_options.enumerate_plugins == nil and wpscan_options.enumerate_only_vulnerable_plugins == nil
|
||||||
@@ -389,7 +389,7 @@ def main
|
|||||||
else
|
else
|
||||||
puts info('No plugins found')
|
puts info('No plugins found')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enumerate the installed plugins
|
# Enumerate the installed plugins
|
||||||
@@ -427,7 +427,7 @@ def main
|
|||||||
else
|
else
|
||||||
puts info('No plugins found')
|
puts info('No plugins found')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enumerate installed themes
|
# Enumerate installed themes
|
||||||
@@ -464,7 +464,7 @@ def main
|
|||||||
else
|
else
|
||||||
puts info('No themes found')
|
puts info('No themes found')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
if wpscan_options.enumerate_timthumbs
|
if wpscan_options.enumerate_timthumbs
|
||||||
@@ -487,7 +487,7 @@ def main
|
|||||||
else
|
else
|
||||||
puts info('No timthumb files found')
|
puts info('No timthumb files found')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
# If we haven't been supplied a username/usernames list, enumerate them...
|
# If we haven't been supplied a username/usernames list, enumerate them...
|
||||||
@@ -533,7 +533,7 @@ def main
|
|||||||
else
|
else
|
||||||
wp_users << WpUser.new(wp_target.uri, login: wpscan_options.username)
|
wp_users << WpUser.new(wp_target.uri, login: wpscan_options.username)
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
# Start the brute forcer
|
# Start the brute forcer
|
||||||
@@ -566,7 +566,7 @@ def main
|
|||||||
else
|
else
|
||||||
puts critical('Brute forcing aborted')
|
puts critical('Brute forcing aborted')
|
||||||
end
|
end
|
||||||
puts " - - - - -"
|
spacer()
|
||||||
end
|
end
|
||||||
|
|
||||||
stop_time = Time.now
|
stop_time = Time.now
|
||||||
|
|||||||
Reference in New Issue
Block a user