wpscan 3.3.2 → 3.3.3

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
  SHA1:
3
- metadata.gz: 8dda343622bf0697b7550b1254b6ca134d008dd6
4
- data.tar.gz: 37e9aea11ee2b721556f7d79f46f5a9e0c51cbb4
3
+ metadata.gz: ffec7e5575986f44b69b35726856004fa2940ecf
4
+ data.tar.gz: 98693ec1db3bbf8f8198b99ee6aeece4312ce782
5
5
  SHA512:
6
- metadata.gz: 441dc0b1704f815839579727c46f7c5b3f32dc4f4e80fe6b06f60397494f28ff29ce5d0efdd70b2d22cdad7c78a21a175d89c58f5910447aa11832906ac97654
7
- data.tar.gz: c6513a30c849d6de42da986703caa8810c3d45dddfadb96e661d1ffdc661bf57b4425a7f9b035bcfd0edd566b14cd481c1ecc9555343033d68154eddd4aedc1e
6
+ metadata.gz: 5952cf3e2d834995600a67cb5b57a1a5404b61a81ea7ec70efb40bc3d4047075d5b148c71efcf9a57efe3cce6b1323cc4ac7a619c1541f0ba01c836c7c293134
7
+ data.tar.gz: b6e7ab1f1e0d158bcabf23599bc4c65399a275a7b063b91e9c1826d88b2032af47ebaf34bc7a0d8ceefa9b41160c762b49c7a821c4366a301af8fc8e8503abcb
@@ -15,20 +15,20 @@ module WPScan
15
15
  OptMultiChoices.new(
16
16
  ['-e', '--enumerate [OPTS]', 'Enumeration Process'],
17
17
  choices: {
18
- vp: OptBoolean.new(['--vulnerable-plugins']),
19
- ap: OptBoolean.new(['--all-plugins']),
20
- p: OptBoolean.new(['--plugins']),
21
- vt: OptBoolean.new(['--vulnerable-themes']),
22
- at: OptBoolean.new(['--all-themes']),
23
- t: OptBoolean.new(['--themes']),
24
- tt: OptBoolean.new(['--timthumbs']),
25
- cb: OptBoolean.new(['--config-backups']),
18
+ vp: OptBoolean.new(['--vulnerable-plugins']),
19
+ ap: OptBoolean.new(['--all-plugins']),
20
+ p: OptBoolean.new(['--plugins']),
21
+ vt: OptBoolean.new(['--vulnerable-themes']),
22
+ at: OptBoolean.new(['--all-themes']),
23
+ t: OptBoolean.new(['--themes']),
24
+ tt: OptBoolean.new(['--timthumbs']),
25
+ cb: OptBoolean.new(['--config-backups']),
26
26
  dbe: OptBoolean.new(['--db-exports']),
27
- u: OptIntegerRange.new(['--users', 'User IDs range. e.g: u1-5'], value_if_empty: '1-10'),
28
- m: OptIntegerRange.new(['--medias',
29
- 'Media IDs range. e.g m1-15',
30
- 'Note: Permalink setting must be set to "Plain" for those to be detected'],
31
- value_if_empty: '1-100')
27
+ u: OptIntegerRange.new(['--users', 'User IDs range. e.g: u1-5'], value_if_empty: '1-10'),
28
+ m: OptIntegerRange.new(['--medias',
29
+ 'Media IDs range. e.g m1-15',
30
+ 'Note: Permalink setting must be set to "Plain" for those to be detected'],
31
+ value_if_empty: '1-100')
32
32
  },
33
33
  value_if_empty: 'vp,vt,tt,cb,dbe,u,m',
34
34
  incompatible: [%i[vp ap p], %i[vt at t]],
@@ -11,7 +11,7 @@ module WPScan
11
11
 
12
12
  return unless [200, 403].include?(res.code) && !target.homepage_or_404?(res)
13
13
 
14
- WPScan::InterestingFinding.new(
14
+ WPScan::BackupDB.new(
15
15
  url,
16
16
  confidence: 70,
17
17
  found_by: DIRECT_ACCESS,
@@ -9,7 +9,7 @@ module WPScan
9
9
 
10
10
  return unless target.debug_log?(path)
11
11
 
12
- WPScan::InterestingFinding.new(
12
+ WPScan::DebugLog.new(
13
13
  target.url(path),
14
14
  confidence: 100, found_by: DIRECT_ACCESS
15
15
  )
@@ -10,7 +10,7 @@ module WPScan
10
10
 
11
11
  return unless res.body =~ /DUPLICATOR INSTALL-LOG/
12
12
 
13
- WPScan::InterestingFinding.new(
13
+ WPScan::DuplicatorInstallerLog.new(
14
14
  url,
15
15
  confidence: 100,
16
16
  found_by: DIRECT_ACCESS,
@@ -10,7 +10,7 @@ module WPScan
10
10
 
11
11
  return unless res.code == 200 && !target.homepage_or_404?(res)
12
12
 
13
- WPScan::InterestingFinding.new(
13
+ WPScan::EmergencyPwdResetScript.new(
14
14
  url,
15
15
  confidence: res.body =~ /password/i ? 100 : 40,
16
16
  found_by: DIRECT_ACCESS,
@@ -10,7 +10,7 @@ module WPScan
10
10
 
11
11
  return if fpd_entries.empty?
12
12
 
13
- WPScan::InterestingFinding.new(
13
+ WPScan::FullPathDisclosure.new(
14
14
  target.url(path),
15
15
  confidence: 100,
16
16
  found_by: DIRECT_ACCESS,
@@ -12,7 +12,7 @@ module WPScan
12
12
 
13
13
  url = target.url('wp-content/mu-plugins/')
14
14
 
15
- return WPScan::InterestingFinding.new(
15
+ return WPScan::MuPlugins.new(
16
16
  url,
17
17
  confidence: 70,
18
18
  found_by: 'URLs In Homepage (Passive Detection)',
@@ -35,7 +35,7 @@ module WPScan
35
35
 
36
36
  target.mu_plugins = true
37
37
 
38
- WPScan::InterestingFinding.new(
38
+ WPScan::MuPlugins.new(
39
39
  url,
40
40
  confidence: 80,
41
41
  found_by: DIRECT_ACCESS,
@@ -15,7 +15,7 @@ module WPScan
15
15
 
16
16
  target.multisite = true
17
17
 
18
- WPScan::InterestingFinding.new(
18
+ WPScan::Multisite.new(
19
19
  url,
20
20
  confidence: 100,
21
21
  found_by: DIRECT_ACCESS,
@@ -10,7 +10,7 @@ module WPScan
10
10
  res = Browser.get(url)
11
11
 
12
12
  if res.code == 200 && res.body =~ /wordpress/i
13
- return WPScan::InterestingFinding.new(url, confidence: 100, found_by: DIRECT_ACCESS)
13
+ return WPScan::Readme.new(url, confidence: 100, found_by: DIRECT_ACCESS)
14
14
  end
15
15
  end
16
16
  nil
@@ -18,7 +18,7 @@ module WPScan
18
18
 
19
19
  target.registration_enabled = true
20
20
 
21
- WPScan::InterestingFinding.new(
21
+ WPScan::Registration.new(
22
22
  res.effective_url,
23
23
  confidence: 100,
24
24
  found_by: DIRECT_ACCESS,
@@ -11,7 +11,7 @@ module WPScan
11
11
 
12
12
  return unless res.code == 200 && res.headers['Content-Type'] =~ %r{\Aapplication/zip}i
13
13
 
14
- WPScan::InterestingFinding.new(
14
+ WPScan::TmmDbMigrate.new(
15
15
  url,
16
16
  confidence: 100,
17
17
  found_by: DIRECT_ACCESS,
@@ -11,7 +11,7 @@ module WPScan
11
11
 
12
12
  url = target.url(path)
13
13
 
14
- WPScan::InterestingFinding.new(
14
+ WPScan::UploadDirectoryListing.new(
15
15
  url,
16
16
  confidence: 100,
17
17
  found_by: DIRECT_ACCESS,
@@ -3,7 +3,7 @@ module WPScan
3
3
  module InterestingFindings
4
4
  # UploadSQLDump finder
5
5
  class UploadSQLDump < CMSScanner::Finders::Finder
6
- SQL_PATTERN = /(?:(?:(?:DROP|CREATE) TABLE)|INSERT INTO)/
6
+ SQL_PATTERN = /(?:(?:(?:DROP|CREATE) TABLE)|INSERT INTO)/.freeze
7
7
 
8
8
  # @return [ InterestingFinding ]
9
9
  def aggressive(_opts = {})
@@ -12,7 +12,7 @@ module WPScan
12
12
 
13
13
  return unless res.code == 200 && res.body =~ SQL_PATTERN
14
14
 
15
- WPScan::InterestingFinding.new(
15
+ WPScan::UploadSQLDump.new(
16
16
  url,
17
17
  confidence: 100,
18
18
  found_by: DIRECT_ACCESS
@@ -3,9 +3,9 @@ module WPScan
3
3
  module MainTheme
4
4
  # From the WooFramework meta generators
5
5
  class WooFrameworkMetaGenerator < CMSScanner::Finders::Finder
6
- THEME_PATTERN = %r{<meta name="generator" content="([^\s"]+)\s?([^"]+)?"\s+/?>}
7
- FRAMEWORK_PATTERN = %r{<meta name="generator" content="WooFramework\s?([^"]+)?"\s+/?>}
8
- PATTERN = /#{THEME_PATTERN}\s+#{FRAMEWORK_PATTERN}/i
6
+ THEME_PATTERN = %r{<meta name="generator" content="([^\s"]+)\s?([^"]+)?"\s+/?>}.freeze
7
+ FRAMEWORK_PATTERN = %r{<meta name="generator" content="WooFramework\s?([^"]+)?"\s+/?>}.freeze
8
+ PATTERN = /#{THEME_PATTERN}\s+#{FRAMEWORK_PATTERN}/i.freeze
9
9
 
10
10
  def passive(opts = {})
11
11
  return unless target.homepage_res.body =~ PATTERN
data/app/finders/users.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'users/oembed_api'
4
4
  require_relative 'users/rss_generator'
5
5
  require_relative 'users/author_id_brute_forcing'
6
6
  require_relative 'users/login_error_messages'
7
+ require_relative 'users/yoast_seo_author_sitemap.rb'
7
8
 
8
9
  module WPScan
9
10
  module Finders
@@ -19,6 +20,7 @@ module WPScan
19
20
  Users::WpJsonApi.new(target) <<
20
21
  Users::OembedApi.new(target) <<
21
22
  Users::RSSGenerator.new(target) <<
23
+ Users::YoastSeoAuthorSitemap.new(target) <<
22
24
  Users::AuthorIdBruteForcing.new(target) <<
23
25
  Users::LoginErrorMessages.new(target)
24
26
  end
@@ -0,0 +1,34 @@
1
+ module WPScan
2
+ module Finders
3
+ module Users
4
+ # The YOAST SEO plugin has an author-sitemap.xml which can leak usernames
5
+ # See https://github.com/wpscanteam/wpscan/issues/1228
6
+ class YoastSeoAuthorSitemap < CMSScanner::Finders::Finder
7
+ # @param [ Hash ] opts
8
+ #
9
+ # @return [ Array<User> ]
10
+ def aggressive(_opts = {})
11
+ found = []
12
+
13
+ Browser.get(sitemap_url).html.xpath('//url/loc').each do |user_tag|
14
+ username = user_tag.text.to_s[%r{/author/([^\/]+)/}, 1]
15
+
16
+ next unless username && !username.strip.empty?
17
+
18
+ found << CMSScanner::User.new(username,
19
+ found_by: found_by,
20
+ confidence: 100,
21
+ interesting_entries: [sitemap_url])
22
+ end
23
+
24
+ found
25
+ end
26
+
27
+ # @return [ String ] The URL of the author-sitemap
28
+ def sitemap_url
29
+ @sitemap_url ||= target.url('author-sitemap.xml')
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -3,4 +3,43 @@ module WPScan
3
3
  class InterestingFinding < CMSScanner::InterestingFinding
4
4
  include References
5
5
  end
6
+
7
+ #
8
+ # Empty classes for the #type to be correctly displayed (as taken from the self.class from the parent)
9
+ #
10
+ class BackupDB < InterestingFinding
11
+ end
12
+
13
+ class DebugLog < InterestingFinding
14
+ end
15
+
16
+ class DuplicatorInstallerLog < InterestingFinding
17
+ end
18
+
19
+ class EmergencyPwdResetScript < InterestingFinding
20
+ end
21
+
22
+ class FullPathDisclosure < InterestingFinding
23
+ end
24
+
25
+ class MuPlugins < InterestingFinding
26
+ end
27
+
28
+ class Multisite < InterestingFinding
29
+ end
30
+
31
+ class Readme < InterestingFinding
32
+ end
33
+
34
+ class Registration < InterestingFinding
35
+ end
36
+
37
+ class TmmDbMigrate < InterestingFinding
38
+ end
39
+
40
+ class UploadDirectoryListing < InterestingFinding
41
+ end
42
+
43
+ class UploadSQLDump < InterestingFinding
44
+ end
6
45
  end
@@ -60,12 +60,11 @@ module WPScan
60
60
  end
61
61
 
62
62
  # @return [ Hash ] The params for Typhoeus::Request
63
+ # @note Those params can't be overriden by CLI options
63
64
  def request_params
64
65
  {
65
- ssl_verifyhost: 2,
66
- ssl_verifypeer: true,
67
- timeout: 300,
68
- connecttimeout: 120,
66
+ timeout: 600,
67
+ connecttimeout: 300,
69
68
  accept_encoding: 'gzip, deflate',
70
69
  cache_ttl: 0
71
70
  }
@@ -9,7 +9,7 @@ module WPScan
9
9
  module WordPress
10
10
  include CMSScanner::Target::Platform::PHP
11
11
 
12
- WORDPRESS_PATTERN = %r{/(?:(?:wp-content/(?:themes|(?:mu\-)?plugins|uploads))|wp-includes)/}i
12
+ WORDPRESS_PATTERN = %r{/(?:(?:wp-content/(?:themes|(?:mu\-)?plugins|uploads))|wp-includes)/}i.freeze
13
13
 
14
14
  # These methods are used in the associated interesting_findings finders
15
15
  # to keep the boolean state of the finding rather than re-check the whole thing again
@@ -41,7 +41,7 @@ module WPScan
41
41
  end
42
42
 
43
43
  def wordpress_hosted?
44
- uri.host =~ /wordpress.com$/i ? true : false
44
+ uri.host =~ /\.wordpress\.com$/i ? true : false
45
45
  end
46
46
 
47
47
  # @param [ String ] username
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module WPScan
3
- VERSION = '3.3.2'.freeze
3
+ VERSION = '3.3.3'.freeze
4
4
  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.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-20 00:00:00.000000000 Z
11
+ date: 2018-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cms_scanner
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.40.2
19
+ version: 0.0.40.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.40.2
26
+ version: 0.0.40.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.59.2
131
+ version: 0.60.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.59.2
138
+ version: 0.60.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -242,6 +242,7 @@ files:
242
242
  - app/finders/users/oembed_api.rb
243
243
  - app/finders/users/rss_generator.rb
244
244
  - app/finders/users/wp_json_api.rb
245
+ - app/finders/users/yoast_seo_author_sitemap.rb
245
246
  - app/finders/wp_items.rb
246
247
  - app/finders/wp_items/urls_in_homepage.rb
247
248
  - app/finders/wp_version.rb