File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
lib/wpscan/target/platform Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ module Platform
1111 module WordPress
1212 include CMSScanner ::Target ::Platform ::PHP
1313
14- WORDPRESS_PATTERN = %r{/(?:(?:wp-content/(?:themes|(?:mu-)?plugins|uploads))|wp-includes)/}i . freeze
15- WP_JSON_OEMBED_PATTERN = %r{/wp-json/oembed/}i . freeze
16- WP_ADMIN_AJAX_PATTERN = %r{\\ ?/wp-admin\\ ?/admin-ajax\. php}i . freeze
14+ WORDPRESS_PATTERN = %r{/(?:(?:wp-content/(?:themes|(?:mu-)?plugins|uploads))|wp-includes)/}i . freeze
15+ WORDPRESS_HOSTED_PATTERN = %r{https?://s\d \. wp\. com#{ WORDPRESS_PATTERN } }i . freeze
16+ WP_JSON_OEMBED_PATTERN = %r{/wp-json/oembed/}i . freeze
17+ WP_ADMIN_AJAX_PATTERN = %r{\\ ?/wp-admin\\ ?/admin-ajax\. php}i . freeze
1718
1819 # These methods are used in the associated interesting_findings finders
1920 # to keep the boolean state of the finding rather than re-check the whole thing again
@@ -103,11 +104,8 @@ def wordpress_hosted?
103104 return true if /\. wordpress\. com$/i . match? ( uri . host )
104105
105106 unless content_dir
106- pattern = %r{https?://s\d \. wp\. com#{ WORDPRESS_PATTERN } }i . freeze
107- xpath = '(//@href|//@src)[contains(., "wp.com")]'
108-
109- uris_from_page ( homepage_res , xpath ) do |uri |
110- return true if uri . to_s . match? ( pattern )
107+ uris_from_page ( homepage_res , '(//@href|//@src)[contains(., "wp.com")]' ) do |uri |
108+ return true if uri . to_s . match? ( WORDPRESS_HOSTED_PATTERN )
111109 end
112110 end
113111
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def rspec_parsed_options(args)
5454 a << WPScan ::Controller . const_get ( sym ) . new
5555 end
5656
57- controllers . option_parser . results ( args . split ( ' ' ) )
57+ controllers . option_parser . results ( args . split )
5858end
5959
6060# TODO: remove when https://github.com/bblimke/webmock/issues/552 fixed
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ Gem::Specification.new do |s|
2828 s . add_development_dependency 'rake' , '~> 13.0'
2929 s . add_development_dependency 'rspec' , '~> 3.10.0'
3030 s . add_development_dependency 'rspec-its' , '~> 1.3.0'
31- s . add_development_dependency 'rubocop' , '~> 1.3.0 '
32- s . add_development_dependency 'rubocop-performance' , '~> 1.8 .0'
31+ s . add_development_dependency 'rubocop' , '~> 1.4.2 '
32+ s . add_development_dependency 'rubocop-performance' , '~> 1.9 .0'
3333 s . add_development_dependency 'simplecov' , '~> 0.19.0'
3434 s . add_development_dependency 'simplecov-lcov' , '~> 0.8.0'
3535 s . add_development_dependency 'stackprof' , '~> 0.2.12'
You can’t perform that action at this time.
0 commit comments