wpscan 3.8.5 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 374d883728b24244fefce17ac5dc35d2fb8ae1d34b161e46cfbe4019d6bcb93e
4
- data.tar.gz: e38d72546d42547c7bfe79d1883db8e7d12dc04ccfc181c572c8b395661d6b65
3
+ metadata.gz: f98f734f7109df65f502a120586451cb9cdcd1f741a03db2d664e5e2b0ebde05
4
+ data.tar.gz: da340ec87c3ac0603b0ffe9fb518067c9cea0596d59bedc15e0dabd7f7e7cfb1
5
5
  SHA512:
6
- metadata.gz: 8b44e8757063dfc2e9aef1a0144c07fb8e5bb4f102e7681442fbdf1b86883bc2677030564b193388f174ddb743fc4dd6ed94e7d40827e8fe28883787a7cf2ca0
7
- data.tar.gz: e8149cb867feb810b996bf3df2ce1df85b7ab8e329c5b8577eb7cf9d516887935f6f6802411adbca4552ba9ac1999dcd1f32ecd4489076123dab75171865c91c
6
+ metadata.gz: 6d45b4fbc1a60f0f804b4fe59815da1ca324693c1546cd1cd91b75fea0aab363fef93ab240ef1009417e8cb7b5230642b6ff464acd90a0bbb917f0ecce915171
7
+ data.tar.gz: 4e0c504291a53f475f834f6b36a14e6634fca79f5cfc03c2375815a509c154047c8da98e25da026d30edd8c4e3bbb2ded4a29d4a678d0e2fe5d10646a6f09f9b
@@ -13,7 +13,7 @@ module WPScan
13
13
  def passive(opts = {})
14
14
  found = []
15
15
 
16
- slugs = items_from_links('themes', false) + items_from_codes('themes', false)
16
+ slugs = items_from_links('themes', uniq: false) + items_from_codes('themes', uniq: false)
17
17
 
18
18
  slugs.each_with_object(Hash.new(0)) { |slug, counts| counts[slug] += 1 }.each do |slug, occurences|
19
19
  found << Model::Theme.new(slug, target, opts.merge(found_by: found_by, confidence: 2 * occurences))
@@ -6,6 +6,7 @@ require_relative 'users/oembed_api'
6
6
  require_relative 'users/rss_generator'
7
7
  require_relative 'users/author_id_brute_forcing'
8
8
  require_relative 'users/login_error_messages'
9
+ require_relative 'users/author_sitemap'
9
10
  require_relative 'users/yoast_seo_author_sitemap'
10
11
 
11
12
  module WPScan
@@ -22,6 +23,7 @@ module WPScan
22
23
  Users::WpJsonApi.new(target) <<
23
24
  Users::OembedApi.new(target) <<
24
25
  Users::RSSGenerator.new(target) <<
26
+ Users::AuthorSitemap.new(target) <<
25
27
  Users::YoastSeoAuthorSitemap.new(target) <<
26
28
  Users::AuthorIdBruteForcing.new(target) <<
27
29
  Users::LoginErrorMessages.new(target)
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WPScan
4
+ module Finders
5
+ module Users
6
+ # Since WP 5.5, /wp-sitemap-users-1.xml is generated and contains
7
+ # the usernames of accounts who made a post
8
+ class AuthorSitemap < CMSScanner::Finders::Finder
9
+ # @param [ Hash ] opts
10
+ #
11
+ # @return [ Array<User> ]
12
+ def aggressive(_opts = {})
13
+ found = []
14
+
15
+ Browser.get(sitemap_url).html.xpath('//url/loc').each do |user_tag|
16
+ username = user_tag.text.to_s[%r{/author/([^/]+)/}, 1]
17
+
18
+ next unless username && !username.strip.empty?
19
+
20
+ found << Model::User.new(username,
21
+ found_by: found_by,
22
+ confidence: 100,
23
+ interesting_entries: [sitemap_url])
24
+ end
25
+
26
+ found
27
+ end
28
+
29
+ # @return [ String ] The URL of the sitemap
30
+ def sitemap_url
31
+ @sitemap_url ||= target.url('wp-sitemap-users-1.xml')
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -5,27 +5,7 @@ module WPScan
5
5
  module Users
6
6
  # The YOAST SEO plugin has an author-sitemap.xml which can leak usernames
7
7
  # See https://github.com/wpscanteam/wpscan/issues/1228
8
- class YoastSeoAuthorSitemap < CMSScanner::Finders::Finder
9
- # @param [ Hash ] opts
10
- #
11
- # @return [ Array<User> ]
12
- def aggressive(_opts = {})
13
- found = []
14
-
15
- Browser.get(sitemap_url).html.xpath('//url/loc').each do |user_tag|
16
- username = user_tag.text.to_s[%r{/author/([^/]+)/}, 1]
17
-
18
- next unless username && !username.strip.empty?
19
-
20
- found << Model::User.new(username,
21
- found_by: found_by,
22
- confidence: 100,
23
- interesting_entries: [sitemap_url])
24
- end
25
-
26
- found
27
- end
28
-
8
+ class YoastSeoAuthorSitemap < AuthorSitemap
29
9
  # @return [ String ] The URL of the author-sitemap
30
10
  def sitemap_url
31
11
  @sitemap_url ||= target.url('author-sitemap.xml')
@@ -9,7 +9,7 @@ module WPScan
9
9
  # @param [ Boolean ] uniq Wether or not to apply the #uniq on the results
10
10
  #
11
11
  # @return [ Array<String> ] The plugins/themes detected in the href, src attributes of the page
12
- def items_from_links(type, uniq = true)
12
+ def items_from_links(type, uniq: true)
13
13
  found = []
14
14
  xpath = format(
15
15
  '(//@href|//@src|//@data-src)[contains(., "%s")]',
@@ -31,7 +31,7 @@ module WPScan
31
31
  # @param [ Boolean ] uniq Wether or not to apply the #uniq on the results
32
32
  #
33
33
  # @return [Array<String> ] The plugins/themes detected in the javascript/style of the homepage
34
- def items_from_codes(type, uniq = true)
34
+ def items_from_codes(type, uniq: true)
35
35
  found = []
36
36
 
37
37
  page_res.html.xpath('//script[not(@src)]|//style[not(@src)]').each do |tag|
@@ -31,7 +31,7 @@ module WPScan
31
31
 
32
32
  finder_configs(
33
33
  finder_class,
34
- Regexp.last_match[1] == 'aggressive'
34
+ aggressive: Regexp.last_match[1] == 'aggressive'
35
35
  )
36
36
  end
37
37
 
@@ -16,7 +16,7 @@ module WPScan
16
16
  # @param [ Symbol ] finder_class
17
17
  # @param [ Boolean ] aggressive
18
18
  # @return [ Hash ]
19
- def self.finder_configs(finder_class, aggressive = false)
19
+ def self.finder_configs(finder_class, aggressive: false)
20
20
  configs = {}
21
21
 
22
22
  return configs unless allowed_classes.include?(finder_class)
@@ -24,7 +24,7 @@ module WPScan
24
24
  # @param [ Symbol ] finder_class
25
25
  # @param [ Boolean ] aggressive
26
26
  # @return [ Hash ]
27
- def self.finder_configs(finder_class, aggressive = false)
27
+ def self.finder_configs(finder_class, aggressive: false)
28
28
  configs = {}
29
29
 
30
30
  return configs unless allowed_classes.include?(finder_class)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module WPScan
5
- VERSION = '3.8.5'
5
+ VERSION = '3.8.6'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wpscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.5
4
+ version: 3.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-25 00:00:00.000000000 Z
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cms_scanner
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.88.0
103
+ version: 0.89.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.88.0
110
+ version: 0.89.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop-performance
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -258,6 +258,7 @@ files:
258
258
  - app/finders/users.rb
259
259
  - app/finders/users/author_id_brute_forcing.rb
260
260
  - app/finders/users/author_posts.rb
261
+ - app/finders/users/author_sitemap.rb
261
262
  - app/finders/users/login_error_messages.rb
262
263
  - app/finders/users/oembed_api.rb
263
264
  - app/finders/users/rss_generator.rb