Improves wp-content detection

This commit is contained in:
erwanlr
2019-04-18 12:13:56 +01:00
parent 210eced369
commit 2fca30752a
4 changed files with 11 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ module WPScan
def content_dir(detection_mode = :mixed)
unless @content_dir
# scope_url_pattern is from CMSScanner::Target
pattern = %r{#{scope_url_pattern}([\w\s\-\/]+)\/(?:themes|plugins|uploads|cache)\/}i
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)
@@ -103,7 +103,7 @@ module WPScan
def sub_dir
unless @sub_dir
# url_pattern is from CMSScanner::Target
pattern = %r{#{url_pattern}(.+?)\/(?:xmlrpc\.php|wp\-includes\/)}i
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)