From 439900a1ea6549b6d22c07a3893ff735e6d36b24 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Tue, 15 May 2018 09:05:58 +0100 Subject: [PATCH] Misc fixes --- lib/wpscan/wp_target/wp_api.rb | 6 +++--- lib/wpscan/wp_target/wp_rss.rb | 17 ++++++++++------- wpscan.rb | 4 ++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/wpscan/wp_target/wp_api.rb b/lib/wpscan/wp_target/wp_api.rb index 09942573..6f8332c1 100644 --- a/lib/wpscan/wp_target/wp_api.rb +++ b/lib/wpscan/wp_target/wp_api.rb @@ -68,10 +68,10 @@ class WpTarget < WebSite users << row end - if users - # Sort and uniq - users = users.sort.uniq + # Sort and uniq + users = users.sort.uniq + if users and users.size > 1 # Feedback grammar = grammar_s(users.size) puts warning("#{users.size} user#{grammar} exposed via API: #{json_users_url}") diff --git a/lib/wpscan/wp_target/wp_rss.rb b/lib/wpscan/wp_target/wp_rss.rb index 5aef1127..fc132cd5 100644 --- a/lib/wpscan/wp_target/wp_rss.rb +++ b/lib/wpscan/wp_target/wp_rss.rb @@ -36,16 +36,19 @@ class WpTarget < WebSite # Read in RSS/XML xml = Nokogiri::XML(data) - # Look for item - xml.xpath('//item/dc:creator').each do |node| - #Format: - users << [%r{.*}i.match(node).to_s] + begin + # Look for item + xml.xpath('//item/dc:creator').each do |node| + #Format: + users << [%r{.*}i.match(node).to_s] + end + rescue end - if users - # Sort and uniq - users = users.sort_by { |user| user.to_s.downcase }.uniq + # Sort and uniq + users = users.sort_by { |user| user.to_s.downcase }.uniq + if users and users.size > 1 # Feedback grammar = grammar_s(users.size) puts warning("Detected #{users.size} user#{grammar} from RSS feed:") diff --git a/wpscan.rb b/wpscan.rb index 92e4513a..936923c0 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -262,7 +262,7 @@ def main if code == 200 puts info("humans.txt available under: #{wp_target.humans_url} [HTTP #{code}]") - wp_target.parse_txt(humans_url).each do |dir| + parse_txt(wp_target.humans_url).each do |dir| puts info("Entry from humans.txt: #{dir}") end spacer() @@ -272,7 +272,7 @@ def main if code == 200 puts info("security.txt available under: #{wp_target.security_url} [HTTP #{code}]") - wp_target.parse_txt(security_url).each do |dir| + parse_txt(wp_target.security_url).each do |dir| puts info("Entry from security.txt: #{dir}") end spacer()