File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
lib/wpscan/target/platform Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ def before_scan
1818 target . content_dir = ParsedCli . wp_content_dir if ParsedCli . wp_content_dir
1919 target . plugins_dir = ParsedCli . wp_plugins_dir if ParsedCli . wp_plugins_dir
2020
21- return if target . content_dir
22-
23- raise Error ::WpContentDirNotDetected
21+ raise Error ::WpContentDirNotDetected unless target . content_dir
2422 end
2523 end
2624 end
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def wordpress?(detection_mode)
4444 # @param [ Typhoeus::Response ] response
4545 # @return [ Boolean ]
4646 def wordpress_from_meta_comments_or_scripts? ( response )
47- in_scope_uris ( response ) do |uri |
47+ in_scope_uris ( response , '//link/@href|//script/@src|//img/@src' ) do |uri |
4848 return true if WORDPRESS_PATTERN . match? ( uri . path ) || WP_JSON_OEMBED_PATTERN . match? ( uri . path )
4949 end
5050
@@ -100,8 +100,9 @@ def wordpress_hosted?
100100
101101 unless content_dir
102102 pattern = %r{https?://s\d \. wp\. com#{ WORDPRESS_PATTERN } }i . freeze
103+ xpath = '//@href[contains(., "wp.com")]|//@src[contains(., "wp.com")]'
103104
104- uris_from_page ( homepage_res ) do |uri |
105+ uris_from_page ( homepage_res , xpath ) do |uri |
105106 return true if uri . to_s . match? ( pattern )
106107 end
107108 end
You can’t perform that action at this time.
0 commit comments