diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index 15d50054..1988ce5d 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -84,10 +84,10 @@ class WpTarget unless @wp_content_dir index_body = Browser.instance.get(@uri.to_s).body - if index_body[%r{/wp-content/themes/}i] + if index_body[%r{/wp-content/(?:themes|plugins)/}i] @wp_content_dir = "wp-content" else - @wp_content_dir = index_body[%r{(?:href|src)=(?:"|')#{@uri}/?(.*)/themes/.*(?:"|')}i, 1] + @wp_content_dir = index_body[%r{(?:href|src)=(?:"|')#{@uri}/?([^"']+)/(?:themes|plugins)/.*(?:"|')}i, 1] end end @wp_content_dir diff --git a/spec/fixtures/wpscan/wp_target/wp_content_dir/wordpress-3.4.1-in-plugins.htm b/spec/fixtures/wpscan/wp_target/wp_content_dir/wordpress-3.4.1-in-plugins.htm new file mode 100644 index 00000000..029b688f --- /dev/null +++ b/spec/fixtures/wpscan/wp_target/wp_content_dir/wordpress-3.4.1-in-plugins.htm @@ -0,0 +1,8 @@ + +
+ + +