Reduces time to detect non WP sites when there are a lof of links in pages
This commit is contained in:
@@ -18,9 +18,7 @@ module WPScan
|
|||||||
target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir
|
target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir
|
||||||
target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir
|
target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir
|
||||||
|
|
||||||
return if target.content_dir
|
raise Error::WpContentDirNotDetected unless target.content_dir
|
||||||
|
|
||||||
raise Error::WpContentDirNotDetected
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ module WPScan
|
|||||||
# @param [ Typhoeus::Response ] response
|
# @param [ Typhoeus::Response ] response
|
||||||
# @return [ Boolean ]
|
# @return [ Boolean ]
|
||||||
def wordpress_from_meta_comments_or_scripts?(response)
|
def wordpress_from_meta_comments_or_scripts?(response)
|
||||||
in_scope_uris(response) do |uri|
|
in_scope_uris(response, '//link/@href|//script/@src|//img/@src') do |uri|
|
||||||
return true if WORDPRESS_PATTERN.match?(uri.path) || WP_JSON_OEMBED_PATTERN.match?(uri.path)
|
return true if WORDPRESS_PATTERN.match?(uri.path) || WP_JSON_OEMBED_PATTERN.match?(uri.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -100,8 +100,9 @@ module WPScan
|
|||||||
|
|
||||||
unless content_dir
|
unless content_dir
|
||||||
pattern = %r{https?://s\d\.wp\.com#{WORDPRESS_PATTERN}}i.freeze
|
pattern = %r{https?://s\d\.wp\.com#{WORDPRESS_PATTERN}}i.freeze
|
||||||
|
xpath = '//@href[contains(., "wp.com")]|//@src[contains(., "wp.com")]'
|
||||||
|
|
||||||
uris_from_page(homepage_res) do |uri|
|
uris_from_page(homepage_res, xpath) do |uri|
|
||||||
return true if uri.to_s.match?(pattern)
|
return true if uri.to_s.match?(pattern)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user