wpscan 3.7.9 → 3.7.10

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: a8351294d3eedeff4b00824a523541cac828c5d43a1852900e606dc22c7676f5
4
- data.tar.gz: d589d01854ee40dd87e073ab636745607434d7fdd1f3e48c269276c68a3fe918
3
+ metadata.gz: e90db053602c7fcca669e5c0e31d93b6ee50ffd189ad6c60015461c63c0d5f9d
4
+ data.tar.gz: 556b07a69059567771ecf05f357396e11f8efa7538dfd1f638e9a2a420f5638e
5
5
  SHA512:
6
- metadata.gz: 6845cdd64b1f715a80b3c932da5e072b465dea4d1af6ec5db67de2585ce8f3366c19ba40071a0de7a6887c79b5db87631630fbad5df4e9de174e29d84afdb5f5
7
- data.tar.gz: 3bb25f129cb00c8a0087d32f88c1423de1bc2d014268d45956e7052134242c3fadeba08cdb183596ce556c76036a08534efc8ef7395a2023d0d614d49185af7c
6
+ metadata.gz: c170ba773c4209f5f93551118cccf5f5be744f3a4d1e0746cec11ae959959f2e386b7f1848d96b72b86aece27abf3431760c131736ba1d55c535eeab563ef1ec
7
+ data.tar.gz: 1b0b3bebf70efa0ac6111b97032b464a8e3188799d016ac5ebbd9c9cdfcfc4d8803291052b3d883a985aa10a77282187f07957080c2b1121b2eb83d3f2031522
data/README.md CHANGED
@@ -130,6 +130,11 @@ cli_options:
130
130
  api_token: YOUR_API_TOKEN
131
131
  ```
132
132
 
133
+ ## Load APi Token From ENV
134
+
135
+ The API Token will be automatically loaded from the ENV variable `WPSCAN_API_TOKEN` if present. If the `--api-token` CLI option is also provided, the value from the CLI will be used.
136
+
137
+
133
138
  ## Enumerating usernames
134
139
 
135
140
  ```shell
@@ -4,6 +4,8 @@ module WPScan
4
4
  module Controller
5
5
  # Controller to handle the API token
6
6
  class VulnApi < CMSScanner::Controller::Base
7
+ ENV_KEY = 'WPSCAN_API_TOKEN'
8
+
7
9
  def cli_options
8
10
  [
9
11
  OptString.new(['--api-token TOKEN', 'The WPVulnDB API Token to display vulnerability data'])
@@ -11,9 +13,9 @@ module WPScan
11
13
  end
12
14
 
13
15
  def before_scan
14
- return unless ParsedCli.api_token
16
+ return unless ParsedCli.api_token || ENV.key?(ENV_KEY)
15
17
 
16
- DB::VulnApi.token = ParsedCli.api_token
18
+ DB::VulnApi.token = ParsedCli.api_token || ENV[ENV_KEY]
17
19
 
18
20
  api_status = DB::VulnApi.status
19
21
 
@@ -16,8 +16,7 @@ module WPScan
16
16
  target.url(path),
17
17
  confidence: 70,
18
18
  found_by: DIRECT_ACCESS,
19
- interesting_entries: target.directory_listing_entries(path),
20
- references: { url: 'https://github.com/wpscanteam/wpscan/issues/422' }
19
+ interesting_entries: target.directory_listing_entries(path)
21
20
  )
22
21
  end
23
22
  end
@@ -11,11 +11,7 @@ module WPScan
11
11
 
12
12
  return unless target.debug_log?(path)
13
13
 
14
- Model::DebugLog.new(
15
- target.url(path),
16
- confidence: 100, found_by: DIRECT_ACCESS,
17
- references: { url: 'https://codex.wordpress.org/Debugging_in_WordPress' }
18
- )
14
+ Model::DebugLog.new(target.url(path), confidence: 100, found_by: DIRECT_ACCESS)
19
15
  end
20
16
  end
21
17
  end
@@ -11,12 +11,7 @@ module WPScan
11
11
 
12
12
  return unless /DUPLICATOR INSTALL-LOG/.match?(target.head_and_get(path).body)
13
13
 
14
- Model::DuplicatorInstallerLog.new(
15
- target.url(path),
16
- confidence: 100,
17
- found_by: DIRECT_ACCESS,
18
- references: { url: 'https://www.exploit-db.com/ghdb/3981/' }
19
- )
14
+ Model::DuplicatorInstallerLog.new(target.url(path), confidence: 100, found_by: DIRECT_ACCESS)
20
15
  end
21
16
  end
22
17
  end
@@ -15,10 +15,7 @@ module WPScan
15
15
  Model::EmergencyPwdResetScript.new(
16
16
  target.url(path),
17
17
  confidence: /password/i.match?(res.body) ? 100 : 40,
18
- found_by: DIRECT_ACCESS,
19
- references: {
20
- url: 'https://codex.wordpress.org/Resetting_Your_Password#Using_the_Emergency_Password_Reset_Script'
21
- }
18
+ found_by: DIRECT_ACCESS
22
19
  )
23
20
  end
24
21
  end
@@ -16,8 +16,7 @@ module WPScan
16
16
  target.url(path),
17
17
  confidence: 100,
18
18
  found_by: DIRECT_ACCESS,
19
- interesting_entries: fpd_entries,
20
- references: { url: 'https://www.owasp.org/index.php/Full_Path_Disclosure' }
19
+ interesting_entries: fpd_entries
21
20
  )
22
21
  end
23
22
  end
@@ -16,13 +16,7 @@ module WPScan
16
16
 
17
17
  target.mu_plugins = true
18
18
 
19
- return Model::MuPlugins.new(
20
- url,
21
- confidence: 70,
22
- found_by: 'URLs In Homepage (Passive Detection)',
23
- to_s: "This site has 'Must Use Plugins': #{url}",
24
- references: { url: 'http://codex.wordpress.org/Must_Use_Plugins' }
25
- )
19
+ return Model::MuPlugins.new(url, confidence: 70, found_by: 'URLs In Homepage (Passive Detection)')
26
20
  end
27
21
  nil
28
22
  end
@@ -37,13 +31,7 @@ module WPScan
37
31
 
38
32
  target.mu_plugins = true
39
33
 
40
- Model::MuPlugins.new(
41
- url,
42
- confidence: 80,
43
- found_by: DIRECT_ACCESS,
44
- to_s: "This site has 'Must Use Plugins': #{url}",
45
- references: { url: 'http://codex.wordpress.org/Must_Use_Plugins' }
46
- )
34
+ Model::MuPlugins.new(url, confidence: 80, found_by: DIRECT_ACCESS)
47
35
  end
48
36
  end
49
37
  end
@@ -17,13 +17,7 @@ module WPScan
17
17
 
18
18
  target.multisite = true
19
19
 
20
- Model::Multisite.new(
21
- url,
22
- confidence: 100,
23
- found_by: DIRECT_ACCESS,
24
- to_s: 'This site seems to be a multisite',
25
- references: { url: 'http://codex.wordpress.org/Glossary#Multisite' }
26
- )
20
+ Model::Multisite.new(url, confidence: 100, found_by: DIRECT_ACCESS)
27
21
  end
28
22
  end
29
23
  end
@@ -20,12 +20,7 @@ module WPScan
20
20
 
21
21
  target.registration_enabled = true
22
22
 
23
- Model::Registration.new(
24
- res.effective_url,
25
- confidence: 100,
26
- found_by: DIRECT_ACCESS,
27
- to_s: "Registration is enabled: #{res.effective_url}"
28
- )
23
+ Model::Registration.new(res.effective_url, confidence: 100, found_by: DIRECT_ACCESS)
29
24
  end
30
25
  end
31
26
  end
@@ -13,12 +13,7 @@ module WPScan
13
13
 
14
14
  return unless res.code == 200 && res.headers['Content-Type'] =~ %r{\Aapplication/zip}i
15
15
 
16
- Model::TmmDbMigrate.new(
17
- url,
18
- confidence: 100,
19
- found_by: DIRECT_ACCESS,
20
- references: { packetstorm: 131_957 }
21
- )
16
+ Model::TmmDbMigrate.new(url, confidence: 100, found_by: DIRECT_ACCESS)
22
17
  end
23
18
  end
24
19
  end
@@ -13,12 +13,7 @@ module WPScan
13
13
 
14
14
  url = target.url(path)
15
15
 
16
- Model::UploadDirectoryListing.new(
17
- url,
18
- confidence: 100,
19
- found_by: DIRECT_ACCESS,
20
- to_s: "Upload directory has listing enabled: #{url}"
21
- )
16
+ Model::UploadDirectoryListing.new(url, confidence: 100, found_by: DIRECT_ACCESS)
22
17
  end
23
18
  end
24
19
  end
@@ -14,11 +14,7 @@ module WPScan
14
14
 
15
15
  return unless SQL_PATTERN.match?(res.body)
16
16
 
17
- Model::UploadSQLDump.new(
18
- target.url(path),
19
- confidence: 100,
20
- found_by: DIRECT_ACCESS
21
- )
17
+ Model::UploadSQLDump.new(target.url(path), confidence: 100, found_by: DIRECT_ACCESS)
22
18
  end
23
19
  end
24
20
  end
@@ -11,17 +11,7 @@ module WPScan
11
11
 
12
12
  return unless res.code == 200
13
13
 
14
- Model::WPCron.new(
15
- wp_cron_url,
16
- confidence: 60,
17
- found_by: DIRECT_ACCESS,
18
- references: {
19
- url: [
20
- 'https://www.iplocation.net/defend-wordpress-from-ddos',
21
- 'https://github.com/wpscanteam/wpscan/issues/1299'
22
- ]
23
- }
24
- )
14
+ Model::WPCron.new(wp_cron_url, confidence: 60, found_by: DIRECT_ACCESS)
25
15
  end
26
16
 
27
17
  def wp_cron_url
@@ -8,45 +8,110 @@ module WPScan
8
8
  end
9
9
 
10
10
  #
11
- # Empty classes for the #type to be correctly displayed (as taken from the self.class from the parent)
11
+ # Some classes are empty for the #type to be correctly displayed (as taken from the self.class from the parent)
12
12
  #
13
13
  class BackupDB < InterestingFinding
14
+ # @return [ Hash ]
15
+ def references
16
+ @references ||= { url: ['https://github.com/wpscanteam/wpscan/issues/422'] }
17
+ end
14
18
  end
15
19
 
16
20
  class DebugLog < InterestingFinding
21
+ # @ return [ Hash ]
22
+ def references
23
+ @references ||= { url: 'https://codex.wordpress.org/Debugging_in_WordPress' }
24
+ end
17
25
  end
18
26
 
19
27
  class DuplicatorInstallerLog < InterestingFinding
28
+ # @return [ Hash ]
29
+ def references
30
+ @references ||= { url: ['https://www.exploit-db.com/ghdb/3981/'] }
31
+ end
20
32
  end
21
33
 
22
34
  class EmergencyPwdResetScript < InterestingFinding
35
+ def references
36
+ @references ||= {
37
+ url: ['https://codex.wordpress.org/Resetting_Your_Password#Using_the_Emergency_Password_Reset_Script']
38
+ }
39
+ end
23
40
  end
24
41
 
25
42
  class FullPathDisclosure < InterestingFinding
43
+ # @return [ Hash ]
44
+ def references
45
+ @references ||= { url: ['https://www.owasp.org/index.php/Full_Path_Disclosure'] }
46
+ end
26
47
  end
27
48
 
28
49
  class MuPlugins < InterestingFinding
50
+ # @return [ String ]
51
+ def to_s
52
+ @to_s ||= "This site has 'Must Use Plugins': #{url}"
53
+ end
54
+
55
+ # @return [ Hash ]
56
+ def references
57
+ @references ||= { url: ['http://codex.wordpress.org/Must_Use_Plugins'] }
58
+ end
29
59
  end
30
60
 
31
61
  class Multisite < InterestingFinding
62
+ # @return [ String ]
63
+ def to_s
64
+ @to_s ||= 'This site seems to be a multisite'
65
+ end
66
+
67
+ # @return [ Hash ]
68
+ def references
69
+ @references ||= { url: ['http://codex.wordpress.org/Glossary#Multisite'] }
70
+ end
32
71
  end
33
72
 
34
73
  class Readme < InterestingFinding
35
74
  end
36
75
 
37
76
  class Registration < InterestingFinding
77
+ # @return [ String ]
78
+ def to_s
79
+ @to_s ||= "Registration is enabled: #{url}"
80
+ end
38
81
  end
39
82
 
40
83
  class TmmDbMigrate < InterestingFinding
84
+ # @return [ Hash ]
85
+ def references
86
+ @references ||= { packetstorm: [131_957] }
87
+ end
41
88
  end
42
89
 
43
90
  class UploadDirectoryListing < InterestingFinding
91
+ # @return [ String ]
92
+ def to_s
93
+ @to_s ||= "Upload directory has listing enabled: #{url}"
94
+ end
44
95
  end
45
96
 
46
97
  class UploadSQLDump < InterestingFinding
47
98
  end
48
99
 
49
100
  class WPCron < InterestingFinding
101
+ # @return [ String ]
102
+ def to_s
103
+ @to_s ||= "The external WP-Cron seems to be enabled: #{url}"
104
+ end
105
+
106
+ # @return [ Hash ]
107
+ def references
108
+ @references ||= {
109
+ url: [
110
+ 'https://www.iplocation.net/defend-wordpress-from-ddos',
111
+ 'https://github.com/wpscanteam/wpscan/issues/1299'
112
+ ]
113
+ }
114
+ end
50
115
  end
51
116
  end
52
117
  end
@@ -8,7 +8,7 @@ module WPScan
8
8
 
9
9
  # @return [ Hash ]
10
10
  def references
11
- {
11
+ @references ||= {
12
12
  url: ['http://codex.wordpress.org/XML-RPC_Pingback_API'],
13
13
  metasploit: [
14
14
  'auxiliary/scanner/http/wordpress_ghost_scanner',
@@ -148,7 +148,7 @@ module WPScan
148
148
  create_backup(filename)
149
149
  dl_checksum = download(filename)
150
150
 
151
- raise "#{filename}: checksums do not match" unless dl_checksum == db_checksum
151
+ raise Error::ChecksumsMismatch, filename unless dl_checksum == db_checksum
152
152
 
153
153
  updated << filename
154
154
  rescue StandardError => e
@@ -8,5 +8,17 @@ module WPScan
8
8
  'Update required, you can not run a scan if a database file is missing.'
9
9
  end
10
10
  end
11
+
12
+ class ChecksumsMismatch < Standard
13
+ attr_reader :db_file
14
+
15
+ def initialize(db_file)
16
+ @db_file = db_file
17
+ end
18
+
19
+ def to_s
20
+ "#{db_file}: checksums do not match. Please try again in a few minutes."
21
+ end
22
+ end
11
23
  end
12
24
  end
@@ -48,7 +48,7 @@ module WPScan
48
48
  # @param [ Typhoeus::Response ] response
49
49
  # @return [ Boolean ]
50
50
  def wordpress_from_meta_comments_or_scripts?(response)
51
- in_scope_uris(response, '//link/@href|//script/@src|//img/@src') do |uri|
51
+ in_scope_uris(response, '//link/@href|//script/@src') do |uri|
52
52
  return true if WORDPRESS_PATTERN.match?(uri.path) || WP_JSON_OEMBED_PATTERN.match?(uri.path)
53
53
  end
54
54
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module WPScan
5
- VERSION = '3.7.9'
5
+ VERSION = '3.7.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.7.9
4
+ version: 3.7.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-02-29 00:00:00.000000000 Z
11
+ date: 2020-03-09 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.8.3
19
+ version: 0.8.5
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.8.3
26
+ version: 0.8.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement