Updates deps

This commit is contained in:
erwanlr
2019-04-24 12:42:18 +01:00
parent f9f307118d
commit 5c842e192b
11 changed files with 26 additions and 32 deletions

View File

@@ -35,15 +35,13 @@ module WPScan
def scan_response(response)
found = {}
target.in_scope_urls(response, xpath) do |url, _tag|
uri = Addressable::URI.parse(url)
target.in_scope_uris(response, xpath) do |uri|
next unless uri.path =~ path_pattern && uri.query&.match(self.class::PATTERN)
version = Regexp.last_match[:v].to_s
found[version] ||= []
found[version] << url
found[version] << uri.to_s
end
found

View File

@@ -24,8 +24,8 @@ module WPScan
#
# @return [ Boolean ]
def wordpress?(detection_mode)
in_scope_urls(homepage_res) do |url|
return true if Addressable::URI.parse(url).path.match(WORDPRESS_PATTERN)
in_scope_uris(homepage_res) do |uri|
return true if uri.path.match(WORDPRESS_PATTERN)
end
homepage_res.html.css('meta[name="generator"]').each do |node|
@@ -36,8 +36,8 @@ module WPScan
if %i[mixed aggressive].include?(detection_mode)
%w[wp-admin/install.php wp-login.php].each do |path|
in_scope_urls(Browser.get_and_follow_location(url(path))).each do |url|
return true if Addressable::URI.parse(url).path.match(WORDPRESS_PATTERN)
in_scope_uris(Browser.get_and_follow_location(url(path))).each do |uri|
return true if uri.path.match(WORDPRESS_PATTERN)
end
end
end
@@ -85,8 +85,8 @@ module WPScan
unless content_dir(:passive)
pattern = %r{https?://s\d\.wp\.com#{WORDPRESS_PATTERN}}i.freeze
urls_from_page(homepage_res) do |url|
return true if url.match?(pattern)
uris_from_page(homepage_res) do |uri|
return true if uri.to_s.match?(pattern)
end
end

View File

@@ -20,8 +20,8 @@ module WPScan
# scope_url_pattern is from CMSScanner::Target
pattern = %r{#{scope_url_pattern}([\w\s\-/]+)\\?/(?:themes|plugins|uploads|cache)\\?/}i
in_scope_urls(homepage_res) do |url|
return @content_dir = Regexp.last_match[1] if url.match(pattern)
in_scope_uris(homepage_res) do |uri|
return @content_dir = Regexp.last_match[1] if uri.to_s.match(pattern)
end
# Checks for the pattern in raw JS code, as well as @content attributes of meta tags
@@ -105,8 +105,8 @@ module WPScan
# url_pattern is from CMSScanner::Target
pattern = %r{#{url_pattern}(.+?)/(?:xmlrpc\.php|wp\-includes/)}i
in_scope_urls(homepage_res) do |url|
return @sub_dir = Regexp.last_match[1] if url.match(pattern)
in_scope_uris(homepage_res) do |uri|
return @sub_dir = Regexp.last_match[1] if uri.to_s.match(pattern)
end
@sub_dir = false