wpscan 3.8.5 → 3.8.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 374d883728b24244fefce17ac5dc35d2fb8ae1d34b161e46cfbe4019d6bcb93e
4
- data.tar.gz: e38d72546d42547c7bfe79d1883db8e7d12dc04ccfc181c572c8b395661d6b65
3
+ metadata.gz: 80bb171dc3d30fab68355160acacb8359681a85fb7f43ca11dc17968cb8b354f
4
+ data.tar.gz: ae033388eb73cbe1bc736edf32b54170cf12f0fb085ee76799fa207ca885a5d7
5
5
  SHA512:
6
- metadata.gz: 8b44e8757063dfc2e9aef1a0144c07fb8e5bb4f102e7681442fbdf1b86883bc2677030564b193388f174ddb743fc4dd6ed94e7d40827e8fe28883787a7cf2ca0
7
- data.tar.gz: e8149cb867feb810b996bf3df2ce1df85b7ab8e329c5b8577eb7cf9d516887935f6f6802411adbca4552ba9ac1999dcd1f32ecd4489076123dab75171865c91c
6
+ metadata.gz: d0023c87de0d517a6eaf08ea8faf7a1a4681cad7a217bb8ee0201aa52f2ef209f64954cde27ea7d9ea2926e24800e377c43d2a4885ed15b3439468292006fb44
7
+ data.tar.gz: c01434b18a3682a190cf101e3a94622742dded2b5320c03bbb15eb515056531845feea68cc119351f428a73dbd966e6c1cffeb201844daca9734289f925e7e36
data/LICENSE CHANGED
@@ -27,7 +27,7 @@ Example cases which do not require a commercial license, and thus fall under the
27
27
  - Using WPScan to test your own systems.
28
28
  - Any non-commercial use of WPScan.
29
29
 
30
- If you need to purchase a commercial license or are unsure whether you need to purchase a commercial license contact us - team@wpscan.org.
30
+ If you need to purchase a commercial license or are unsure whether you need to purchase a commercial license contact us - contact@wpscan.com.
31
31
 
32
32
  Free-use Terms and Conditions;
33
33
 
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  WordPress Security Scanner
11
11
  <br>
12
12
  <br>
13
- <a href="https://wpscan.org/" title="homepage" target="_blank">Homepage</a> - <a href="https://wpscan.io/" title="wpscan.io" target="_blank">WPScan.io</a> - <a href="https://wpvulndb.com/" title="vulnerability database" target="_blank">Vulnerability Database</a> - <a href="https://wordpress.org/plugins/wpscan/" title="wordpress security plugin" target="_blank">WordPress Security Plugin</a>
13
+ <a href="https://wpscan.com/" title="homepage" target="_blank">WPScan WordPress Vulnerability Database</a> - <a href="https://wordpress.org/plugins/wpscan/" title="wordpress security plugin" target="_blank">WordPress Security Plugin</a>
14
14
  </p>
15
15
 
16
16
  <p align="center">
@@ -82,7 +82,7 @@ The DB is located at ~/.wpscan/db
82
82
 
83
83
  ## Vulnerability Database
84
84
 
85
- The WPScan CLI tool uses the [WPVulnDB API](https://wpvulndb.com/api) to retrieve WordPress vulnerability data in real time. For WPScan to retrieve the vulnerability data an API token must be supplied via the `--api-token` option, or via a configuration file, as discussed below. An API token can be obtained by registering an account on [WPVulnDB](https://wpvulndb.com/users/sign_up). Up to 50 API requests per day are given free of charge to registered users. Once the 50 API requests are exhausted, WPScan will continue to work as normal but without any vulnerability data. Users can upgrade to paid API usage to increase their API limits within their user profile on [WPVulnDB](https://wpvulndb.com/).
85
+ The WPScan CLI tool uses the [WPScan API](https://wpscan.com/api) to retrieve WordPress vulnerability data in real time. For WPScan to retrieve the vulnerability data an API token must be supplied via the `--api-token` option, or via a configuration file, as discussed below. An API token can be obtained by registering an account on [WPScan](https://wpscan.com/register). Up to 50 API requests per day are given free of charge to registered users. Once the 50 API requests are exhausted, WPScan will continue to work as normal but without any vulnerability data. Users can upgrade to paid API usage to increase their API limits within their user profile on [WPScan](https://wpscan.com/).
86
86
 
87
87
  ## Load CLI options from file/s
88
88
 
@@ -19,7 +19,8 @@ module WPScan
19
19
  OptChoice.new(['--password-attack ATTACK',
20
20
  'Force the supplied attack to be used rather than automatically determining one.'],
21
21
  choices: %w[wp-login xmlrpc xmlrpc-multicall],
22
- normalize: %i[downcase underscore to_sym])
22
+ normalize: %i[downcase underscore to_sym]),
23
+ OptString.new(['--login-uri URI', 'The URI of the login page if different from /wp-login.php'])
23
24
  ]
24
25
  end
25
26
 
@@ -9,7 +9,7 @@ module WPScan
9
9
  def aggressive(_opts = {})
10
10
  path = 'installer-log.txt'
11
11
 
12
- return unless /DUPLICATOR INSTALL-LOG/.match?(target.head_and_get(path).body)
12
+ return unless /DUPLICATOR(-|\s)?(PRO|LITE)?:? INSTALL-LOG/i.match?(target.head_and_get(path).body)
13
13
 
14
14
  Model::DuplicatorInstallerLog.new(target.url(path), confidence: 100, found_by: DIRECT_ACCESS)
15
15
  end
@@ -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|
@@ -9,5 +9,5 @@
9
9
  <% end -%>
10
10
  <% else -%>
11
11
  <%= warning_icon %> No WPVulnDB API Token given, as a result vulnerability data has not been output.
12
- <%= warning_icon %> You can get a free API token with 50 daily requests by registering at https://wpvulndb.com/users/sign_up
12
+ <%= warning_icon %> You can get a free API token with 50 daily requests by registering at https://wpscan.com/register
13
13
  <% end -%>
@@ -8,6 +8,6 @@
8
8
  "requests_remaining": <%= @status['requests_remaining'].to_json %>
9
9
  <% end -%>
10
10
  <% else -%>
11
- "error": "No WPVulnDB API Token given, as a result vulnerability data has not been output.\nYou can get a free API token with 50 daily requests by registering at https://wpvulndb.com/users/sign_up"
11
+ "error": "No WPVulnDB API Token given, as a result vulnerability data has not been output.\nYou can get a free API token with 50 daily requests by registering at https://wpscan.com/register"
12
12
  <% end -%>
13
13
  },
@@ -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)
@@ -12,7 +12,7 @@ module WPScan
12
12
 
13
13
  # @return [ Addressable::URI ]
14
14
  def self.uri
15
- @uri ||= Addressable::URI.parse('https://wpvulndb.com/api/v3/')
15
+ @uri ||= Addressable::URI.parse('https://wpscan.com/api/v3/')
16
16
  end
17
17
 
18
18
  # @param [ String ] path
@@ -56,9 +56,7 @@ module WPScan
56
56
 
57
57
  homepage_result = find(target.homepage_res, opts)
58
58
 
59
- if homepage_result
60
- return homepage_result unless homepage_result.is_a?(Array) && homepage_result.empty?
61
- end
59
+ return homepage_result unless homepage_result.nil? || homepage_result.is_a?(Array) && homepage_result&.empty?
62
60
 
63
61
  find(target.error_404_res, opts)
64
62
  end
@@ -27,7 +27,7 @@ module WPScan
27
27
  end
28
28
 
29
29
  def wpvulndb_url(id)
30
- "https://wpvulndb.com/vulnerabilities/#{id}"
30
+ "https://wpscan.com/vulnerability/#{id}"
31
31
  end
32
32
  end
33
33
  end
@@ -139,11 +139,14 @@ module WPScan
139
139
  # the first time the method is called, and the effective_url is then used
140
140
  # if suitable, otherwise the default wp-login will be.
141
141
  #
142
+ # If the login_uri CLI option has been provided, it will be returne w/o redirection check.
143
+ #
142
144
  # @return [ String, false ] The URL to the login page or false if not detected
143
145
  def login_url
144
146
  return @login_url unless @login_url.nil?
147
+ return @login_url = url(ParsedCli.login_uri) if ParsedCli.login_uri
145
148
 
146
- @login_url = url('wp-login.php') # TODO: url(ParsedCli.login_uri)
149
+ @login_url = url('wp-login.php')
147
150
 
148
151
  res = Browser.get_and_follow_location(@login_url)
149
152
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module WPScan
5
- VERSION = '3.8.5'
5
+ VERSION = '3.8.10'
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.10
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-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cms_scanner
@@ -100,42 +100,42 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.88.0
103
+ version: 1.0.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: 1.0.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop-performance
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.7.0
117
+ version: 1.8.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.7.0
124
+ version: 1.8.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.18.2
131
+ version: 0.19.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.18.2
138
+ version: 0.19.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov-lcov
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 3.8.0
173
+ version: 3.9.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 3.8.0
180
+ version: 3.9.0
181
181
  description: WPScan is a black box WordPress vulnerability scanner.
182
182
  email:
183
183
  - team@wpscan.org
@@ -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