Skip to content

Commit

Permalink
Fixes #1411
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed Oct 11, 2019
1 parent b236138 commit 62600b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/wpscan/target/platform/wordpress/custom_directories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def plugins_dir=(dir)
def content_dir
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_uris(homepage_res) do |uri|
return @content_dir = Regexp.last_match[1] if uri.to_s.match(pattern)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

<link rel="stylesheet" href="http://ex.lo/wp-content/plugins/wp-lightbox/js/lightbox/themes/default/jquery.lightbox.css" type="text/css" media="all"/>
<!--[if IE 6]>
<link rel="stylesheet" href="http://ex.lo/wp-content/plugins/wp-lightbox/js/lightbox/themes/default/jquery.lightbox.ie6.css" type="text/css" media="all"/>
<![endif]-->
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
default: 'wp-content', https: 'wp-content', custom_w_spaces: 'custom content spaces',
relative_one: 'wp-content', relative_two: 'wp-content', cache: 'wp-content',
in_raw_js: 'wp-content', in_raw_js_escaped: 'wp-content', with_sub_dir: 'app',
relative_two_sub_dir: 'cms/wp-content', in_meta_content: 'wp-content'
relative_two_sub_dir: 'cms/wp-content', in_meta_content: 'wp-content',
themes_path_plugin_folder: 'wp-content'
}.each do |file, expected|
it "returns #{expected} for #{file}.html" do
stub_request(:get, target.url).to_return(body: File.read(fixtures.join("#{file}.html")))
Expand Down

0 comments on commit 62600b3

Please sign in to comment.