wpscan 3.6.3 → 3.7.0
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 +4 -4
- data/README.md +24 -11
- data/app/controllers.rb +1 -0
- data/app/controllers/vuln_api.rb +30 -0
- data/app/models/plugin.rb +9 -2
- data/app/models/theme.rb +8 -1
- data/app/models/wp_item.rb +3 -3
- data/app/models/wp_version.rb +11 -4
- data/app/views/cli/core/banner.erb +1 -1
- data/app/views/cli/vuln_api/status.erb +13 -0
- data/app/views/json/core/banner.erb +1 -1
- data/app/views/json/vuln_api/status.erb +13 -0
- data/bin/wpscan +1 -0
- data/lib/wpscan.rb +18 -1
- data/lib/wpscan/browser.rb +1 -1
- data/lib/wpscan/db.rb +3 -0
- data/lib/wpscan/db/plugin.rb +3 -3
- data/lib/wpscan/db/plugins.rb +2 -2
- data/lib/wpscan/db/sponsor.rb +16 -0
- data/lib/wpscan/db/theme.rb +3 -3
- data/lib/wpscan/db/themes.rb +2 -2
- data/lib/wpscan/db/updater.rb +6 -3
- data/lib/wpscan/db/vuln_api.rb +78 -0
- data/lib/wpscan/db/wp_item.rb +10 -5
- data/lib/wpscan/db/wp_items.rb +3 -3
- data/lib/wpscan/db/wp_version.rb +3 -3
- data/lib/wpscan/errors.rb +1 -0
- data/lib/wpscan/errors/vuln_api.rb +20 -0
- data/lib/wpscan/finders/dynamic_finder/version/body_pattern.rb +2 -2
- data/lib/wpscan/typhoeus/response.rb +13 -0
- data/lib/wpscan/version.rb +1 -1
- metadata +13 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e98820ee111e0a41e7cdc545d73daf107fc9ac8cec61b0553d19e5e85a8fc5f
|
4
|
+
data.tar.gz: 72e974ecfbd200a92a123c7f315b587c3e8c20364390a202ca8b0ca978a08dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd2778249b8afdfa8a12317ea20b2f856285a83ade81b8e7935cd83721f5763a6f39c9e1b94e7dd8cdfa9f48c0e068bdaf95f3e949506b3ae96b65a0a992b0a3
|
7
|
+
data.tar.gz: 7eb76604ef4f5a7b01dbc5dce70dd4cfa8f3f6d9093642615aae627dfa709dcf0a36ea9e1dae1c4208571946b4d09ca80e8f2496ddeae63660dd314e522e7fb6
|
data/README.md
CHANGED
@@ -84,33 +84,46 @@ For more options, open a terminal and type ```wpscan --help``` (if you built wps
|
|
84
84
|
|
85
85
|
The DB is located at ~/.wpscan/db
|
86
86
|
|
87
|
+
## Load CLI options from file/s
|
88
|
+
|
87
89
|
WPScan can load all options (including the --url) from configuration files, the following locations are checked (order: first to last):
|
88
90
|
|
89
|
-
- ~/.wpscan/
|
90
|
-
- ~/.wpscan/
|
91
|
-
- pwd/.wpscan/
|
92
|
-
- pwd/.wpscan/
|
91
|
+
- ~/.wpscan/scan.json
|
92
|
+
- ~/.wpscan/scan.yml
|
93
|
+
- pwd/.wpscan/scan.json
|
94
|
+
- pwd/.wpscan/scan.yml
|
93
95
|
|
94
|
-
If those files exist, options from
|
96
|
+
If those files exist, options from the `cli_options` key will be loaded and overridden if found twice.
|
95
97
|
|
96
98
|
e.g:
|
97
99
|
|
98
|
-
~/.wpscan/
|
100
|
+
~/.wpscan/scan.yml:
|
99
101
|
|
100
102
|
```yml
|
101
|
-
|
102
|
-
|
103
|
+
cli_options:
|
104
|
+
proxy: 'http://127.0.0.1:8080'
|
105
|
+
verbose: true
|
103
106
|
```
|
104
107
|
|
105
|
-
pwd/.wpscan/
|
108
|
+
pwd/.wpscan/scan.yml:
|
106
109
|
|
107
110
|
```yml
|
108
|
-
|
109
|
-
|
111
|
+
cli_options:
|
112
|
+
proxy: 'socks5://127.0.0.1:9090'
|
113
|
+
url: 'http://target.tld'
|
110
114
|
```
|
111
115
|
|
112
116
|
Running ```wpscan``` in the current directory (pwd), is the same as ```wpscan -v --proxy socks5://127.0.0.1:9090 --url http://target.tld```
|
113
117
|
|
118
|
+
## Save API Token in a file
|
119
|
+
|
120
|
+
The feature mentioned above is useful to keep the API Token in a config file and not have to supply it via the CLI each time. To do so, create the ~/.wpscan/scan.yml file containing the below:
|
121
|
+
|
122
|
+
```yml
|
123
|
+
cli_options:
|
124
|
+
api_token: YOUR_API_TOKEN
|
125
|
+
```
|
126
|
+
|
114
127
|
Enumerating usernames
|
115
128
|
|
116
129
|
```shell
|
data/app/controllers.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WPScan
|
4
|
+
module Controller
|
5
|
+
# Controller to handle the API token
|
6
|
+
class VulnApi < CMSScanner::Controller::Base
|
7
|
+
def cli_options
|
8
|
+
[
|
9
|
+
OptString.new(['--api-token TOKEN', 'The WPVulnDB API Token to display vulnerability data'])
|
10
|
+
]
|
11
|
+
end
|
12
|
+
|
13
|
+
def before_scan
|
14
|
+
return unless ParsedCli.api_token
|
15
|
+
|
16
|
+
DB::VulnApi.token = ParsedCli.api_token
|
17
|
+
|
18
|
+
api_status = DB::VulnApi.status
|
19
|
+
|
20
|
+
raise Error::InvalidApiToken if api_status['error']
|
21
|
+
raise Error::ApiLimitReached if api_status['requests_remaining'] == 0
|
22
|
+
raise api_status['http_error'] if api_status['http_error']
|
23
|
+
end
|
24
|
+
|
25
|
+
def after_scan
|
26
|
+
output('status', status: DB::VulnApi.status, api_requests: WPScan.api_requests)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/app/models/plugin.rb
CHANGED
@@ -15,9 +15,16 @@ module WPScan
|
|
15
15
|
@uri = Addressable::URI.parse(blog.url(path_from_blog))
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
18
|
+
# Retrieve the metadata from the vuln API if available (and a valid token is given),
|
19
|
+
# or the local metadata db otherwise
|
20
|
+
# @return [ Hash ]
|
21
|
+
def metadata
|
22
|
+
@metadata ||= db_data.empty? ? DB::Plugin.metadata_at(slug) : db_data
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [ Hash ]
|
19
26
|
def db_data
|
20
|
-
@db_data ||= DB::
|
27
|
+
@db_data ||= DB::VulnApi.plugin_data(slug)
|
21
28
|
end
|
22
29
|
|
23
30
|
# @param [ Hash ] opts
|
data/app/models/theme.rb
CHANGED
@@ -21,9 +21,16 @@ module WPScan
|
|
21
21
|
parse_style
|
22
22
|
end
|
23
23
|
|
24
|
+
# Retrieve the metadata from the vuln API if available (and a valid token is given),
|
25
|
+
# or the local metadata db otherwise
|
24
26
|
# @return [ JSON ]
|
27
|
+
def metadata
|
28
|
+
@metadata ||= db_data.empty? ? DB::Theme.metadata_at(slug) : db_data
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [ Hash ]
|
25
32
|
def db_data
|
26
|
-
@db_data ||= DB::
|
33
|
+
@db_data ||= DB::VulnApi.theme_data(slug)
|
27
34
|
end
|
28
35
|
|
29
36
|
# @param [ Hash ] opts
|
data/app/models/wp_item.rb
CHANGED
@@ -60,18 +60,18 @@ module WPScan
|
|
60
60
|
|
61
61
|
# @return [ String ]
|
62
62
|
def latest_version
|
63
|
-
@latest_version ||=
|
63
|
+
@latest_version ||= metadata['latest_version'] ? Model::Version.new(metadata['latest_version']) : nil
|
64
64
|
end
|
65
65
|
|
66
66
|
# Not used anywhere ATM
|
67
67
|
# @return [ Boolean ]
|
68
68
|
def popular?
|
69
|
-
@popular ||=
|
69
|
+
@popular ||= metadata['popular'] ? true : false
|
70
70
|
end
|
71
71
|
|
72
72
|
# @return [ String ]
|
73
73
|
def last_updated
|
74
|
-
@last_updated ||=
|
74
|
+
@last_updated ||= metadata['last_updated']
|
75
75
|
end
|
76
76
|
|
77
77
|
# @return [ Boolean ]
|
data/app/models/wp_version.rb
CHANGED
@@ -35,9 +35,16 @@ module WPScan
|
|
35
35
|
@all_numbers.sort! { |a, b| Gem::Version.new(b) <=> Gem::Version.new(a) }
|
36
36
|
end
|
37
37
|
|
38
|
-
#
|
38
|
+
# Retrieve the metadata from the vuln API if available (and a valid token is given),
|
39
|
+
# or the local metadata db otherwise
|
40
|
+
# @return [ Hash ]
|
41
|
+
def metadata
|
42
|
+
@metadata ||= db_data.empty? ? DB::Version.metadata_at(number) : db_data
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [ Hash ]
|
39
46
|
def db_data
|
40
|
-
@db_data ||= DB::
|
47
|
+
@db_data ||= DB::VulnApi.wordpress_data(number)
|
41
48
|
end
|
42
49
|
|
43
50
|
# @return [ Array<Vulnerability> ]
|
@@ -55,12 +62,12 @@ module WPScan
|
|
55
62
|
|
56
63
|
# @return [ String ]
|
57
64
|
def release_date
|
58
|
-
@release_date ||=
|
65
|
+
@release_date ||= metadata['release_date'] || 'Unknown'
|
59
66
|
end
|
60
67
|
|
61
68
|
# @return [ String ]
|
62
69
|
def status
|
63
|
-
@status ||=
|
70
|
+
@status ||= metadata['status'] || 'Unknown'
|
64
71
|
end
|
65
72
|
end
|
66
73
|
end
|
@@ -8,7 +8,7 @@ _______________________________________________________________
|
|
8
8
|
|
9
9
|
WordPress Security Scanner by the WPScan Team
|
10
10
|
Version <%= WPScan::VERSION %>
|
11
|
-
|
11
|
+
<%= ' ' * ((63 - WPScan::DB::Sponsor.text.length)/2) + WPScan::DB::Sponsor.text %>
|
12
12
|
@_WPScan_, @ethicalhack3r, @erwan_lr, @_FireFart_
|
13
13
|
_______________________________________________________________
|
14
14
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% unless @status.empty? -%>
|
2
|
+
<% if @status['http_error'] -%>
|
3
|
+
<%= critical_icon %> WPVulnDB API, <%= @status['http_error'].to_s %>
|
4
|
+
<% else -%>
|
5
|
+
<%= info_icon %> WPVulnDB API OK
|
6
|
+
| Plan: <%= @status['plan'] %>
|
7
|
+
| Requests Done (during the scan): <%= @api_requests %>
|
8
|
+
| Requests Remaining: <%= @status['requests_remaining'] %>
|
9
|
+
<% end -%>
|
10
|
+
<% else -%>
|
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/register.
|
13
|
+
<% end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"vuln_api": {
|
2
|
+
<% unless @status.empty? -%>
|
3
|
+
<% if @status['http_error'] -%>
|
4
|
+
"http_error": <%= @status['http_error'].to_s.to_json %>
|
5
|
+
<% else -%>
|
6
|
+
"plan": <%= @status['plan'].to_json %>,
|
7
|
+
"requests_done_during_scan": <%= @api_requests.to_json %>,
|
8
|
+
"requests_remaining": <%= @status['requests_remaining'].to_json %>
|
9
|
+
<% end -%>
|
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/register."
|
12
|
+
<% end -%>
|
13
|
+
},
|
data/bin/wpscan
CHANGED
data/lib/wpscan.rb
CHANGED
@@ -13,7 +13,8 @@ require 'uri'
|
|
13
13
|
require 'time'
|
14
14
|
require 'readline'
|
15
15
|
require 'securerandom'
|
16
|
-
|
16
|
+
# Monkey Patches/Fixes/Override
|
17
|
+
require 'wpscan/typhoeus/response' # Adds a from_vuln_api? method
|
17
18
|
# Custom Libs
|
18
19
|
require 'wpscan/helper'
|
19
20
|
require 'wpscan/db'
|
@@ -38,12 +39,28 @@ module WPScan
|
|
38
39
|
APP_DIR = Pathname.new(__FILE__).dirname.join('..', 'app').expand_path
|
39
40
|
DB_DIR = Pathname.new(Dir.home).join('.wpscan', 'db')
|
40
41
|
|
42
|
+
Typhoeus.on_complete do |response|
|
43
|
+
next if response.cached? || !response.from_vuln_api?
|
44
|
+
|
45
|
+
self.api_requests += 1
|
46
|
+
end
|
47
|
+
|
41
48
|
# Override, otherwise it would be returned as 'wp_scan'
|
42
49
|
#
|
43
50
|
# @return [ String ]
|
44
51
|
def self.app_name
|
45
52
|
'wpscan'
|
46
53
|
end
|
54
|
+
|
55
|
+
# @return [ Integer ]
|
56
|
+
def self.api_requests
|
57
|
+
@@api_requests ||= 0
|
58
|
+
end
|
59
|
+
|
60
|
+
# @param [ Integer ] value
|
61
|
+
def self.api_requests=(value)
|
62
|
+
@@api_requests = value
|
63
|
+
end
|
47
64
|
end
|
48
65
|
|
49
66
|
require "#{WPScan::APP_DIR}/app"
|
data/lib/wpscan/browser.rb
CHANGED
data/lib/wpscan/db.rb
CHANGED
@@ -7,9 +7,12 @@ require_relative 'db/plugins'
|
|
7
7
|
require_relative 'db/themes'
|
8
8
|
require_relative 'db/plugin'
|
9
9
|
require_relative 'db/theme'
|
10
|
+
require_relative 'db/sponsor'
|
10
11
|
require_relative 'db/wp_version'
|
11
12
|
require_relative 'db/fingerprints'
|
12
13
|
|
14
|
+
require_relative 'db/vuln_api'
|
15
|
+
|
13
16
|
require_relative 'db/dynamic_finders/base'
|
14
17
|
require_relative 'db/dynamic_finders/plugin'
|
15
18
|
require_relative 'db/dynamic_finders/theme'
|
data/lib/wpscan/db/plugin.rb
CHANGED
data/lib/wpscan/db/plugins.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WPScan
|
4
|
+
module DB
|
5
|
+
class Sponsor
|
6
|
+
# @return [ Hash ]
|
7
|
+
def self.text
|
8
|
+
@text ||= file_path.exist? ? File.read(file_path).chomp : ''
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.file_path
|
12
|
+
@file_path ||= DB_DIR.join('sponsor.txt')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/wpscan/db/theme.rb
CHANGED
data/lib/wpscan/db/themes.rb
CHANGED
data/lib/wpscan/db/updater.rb
CHANGED
@@ -7,12 +7,15 @@ module WPScan
|
|
7
7
|
class Updater
|
8
8
|
# /!\ Might want to also update the Enumeration#cli_options when some filenames are changed here
|
9
9
|
FILES = %w[
|
10
|
-
|
10
|
+
metadata.json wp_fingerprints.json
|
11
11
|
timthumbs-v3.txt config_backups.txt db_exports.txt
|
12
|
-
dynamic_finders.yml
|
12
|
+
dynamic_finders.yml LICENSE sponsor.txt
|
13
13
|
].freeze
|
14
14
|
|
15
|
-
OLD_FILES = %w[
|
15
|
+
OLD_FILES = %w[
|
16
|
+
wordpress.db user-agents.txt dynamic_finders_01.yml
|
17
|
+
wordpresses.json plugins.json themes.json
|
18
|
+
].freeze
|
16
19
|
|
17
20
|
attr_reader :repo_directory
|
18
21
|
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WPScan
|
4
|
+
module DB
|
5
|
+
# WPVulnDB API
|
6
|
+
class VulnApi
|
7
|
+
NON_ERROR_CODES = [200, 401, 404].freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_accessor :token
|
11
|
+
end
|
12
|
+
|
13
|
+
# @return [ Addressable::URI ]
|
14
|
+
def self.uri
|
15
|
+
@uri ||= Addressable::URI.parse('https://wpvulndb.com/api/v3/')
|
16
|
+
end
|
17
|
+
|
18
|
+
# @param [ String ] path
|
19
|
+
# @param [ Hash ] params
|
20
|
+
#
|
21
|
+
# @return [ Hash ]
|
22
|
+
def self.get(path, params = {})
|
23
|
+
return {} unless token
|
24
|
+
|
25
|
+
res = Browser.get(uri.join(path), params.merge(request_params))
|
26
|
+
|
27
|
+
return JSON.parse(res.body) if NON_ERROR_CODES.include?(res.code)
|
28
|
+
|
29
|
+
raise Error::HTTP, res
|
30
|
+
rescue Error::HTTP => e
|
31
|
+
retries ||= 0
|
32
|
+
|
33
|
+
if (retries += 1) <= 3
|
34
|
+
sleep(1)
|
35
|
+
retry
|
36
|
+
end
|
37
|
+
|
38
|
+
{ 'http_error' => e }
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [ Hash ]
|
42
|
+
def self.plugin_data(slug)
|
43
|
+
get("plugins/#{slug}")&.dig(slug) || {}
|
44
|
+
end
|
45
|
+
|
46
|
+
# @return [ Hash ]
|
47
|
+
def self.theme_data(slug)
|
48
|
+
get("themes/#{slug}")&.dig(slug) || {}
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [ Hash ]
|
52
|
+
def self.wordpress_data(version_number)
|
53
|
+
get("wordpresses/#{version_number.tr('.', '')}")&.dig(version_number) || {}
|
54
|
+
end
|
55
|
+
|
56
|
+
# @return [ Hash ]
|
57
|
+
def self.status
|
58
|
+
json = get('status', params: { version: WPScan::VERSION }, cache_ttl: 0)
|
59
|
+
|
60
|
+
json['requests_remaining'] = 'Unlimited' if json['requests_remaining'] == -1
|
61
|
+
|
62
|
+
json
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [ Hash ]
|
66
|
+
def self.request_params
|
67
|
+
{
|
68
|
+
headers: {
|
69
|
+
'Host' => uri.host, # Reset in case user provided a --vhost for the target
|
70
|
+
'Referer' => nil, # Removes referer set by the cmsscanner to the target url
|
71
|
+
'User-Agent' => Browser.instance.default_user_agent,
|
72
|
+
'Authorization' => "Token token=#{token}"
|
73
|
+
}
|
74
|
+
}
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/lib/wpscan/db/wp_item.rb
CHANGED
@@ -6,14 +6,19 @@ module WPScan
|
|
6
6
|
class WpItem
|
7
7
|
# @param [ String ] identifier The plugin/theme slug or version number
|
8
8
|
#
|
9
|
-
# @return [ Hash ] The JSON data from the
|
10
|
-
def self.
|
11
|
-
|
9
|
+
# @return [ Hash ] The JSON data from the metadata associated to the identifier
|
10
|
+
def self.metadata_at(identifier)
|
11
|
+
metadata[identifier] || {}
|
12
12
|
end
|
13
13
|
|
14
14
|
# @return [ JSON ]
|
15
|
-
def self.
|
16
|
-
@
|
15
|
+
def self.metadata
|
16
|
+
@metadata ||= read_json_file(metadata_file)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [ String ]
|
20
|
+
def self.metadata_file
|
21
|
+
@metadata_file ||= DB_DIR.join('metadata.json').to_s
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
data/lib/wpscan/db/wp_items.rb
CHANGED
@@ -6,17 +6,17 @@ module WPScan
|
|
6
6
|
class WpItems
|
7
7
|
# @return [ Array<String> ] The slug of all items
|
8
8
|
def self.all_slugs
|
9
|
-
|
9
|
+
metadata.keys
|
10
10
|
end
|
11
11
|
|
12
12
|
# @return [ Array<String> ] The slug of all popular items
|
13
13
|
def self.popular_slugs
|
14
|
-
|
14
|
+
metadata.select { |_key, item| item['popular'] == true }.keys
|
15
15
|
end
|
16
16
|
|
17
17
|
# @return [ Array<String> ] The slug of all vulnerable items
|
18
18
|
def self.vulnerable_slugs
|
19
|
-
|
19
|
+
metadata.select { |_key, item| item['vulnerabilities'] == true }.keys
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/wpscan/db/wp_version.rb
CHANGED
@@ -4,9 +4,9 @@ module WPScan
|
|
4
4
|
module DB
|
5
5
|
# WP Version
|
6
6
|
class Version < WpItem
|
7
|
-
# @return [
|
8
|
-
def self.
|
9
|
-
@
|
7
|
+
# @return [ Hash ]
|
8
|
+
def self.metadata
|
9
|
+
@metadata ||= super['wordpress'] || {}
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/wpscan/errors.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WPScan
|
4
|
+
module Error
|
5
|
+
# Error raised when the token given via --api-token is invalid
|
6
|
+
class InvalidApiToken < Standard
|
7
|
+
def to_s
|
8
|
+
'The API token provided is invalid'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# Error raised when the number of API requests has been reached
|
13
|
+
# currently not implemented on the API side
|
14
|
+
class ApiLimitReached < Standard
|
15
|
+
def to_s
|
16
|
+
'Your API limit has been reached'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -4,7 +4,7 @@ module WPScan
|
|
4
4
|
module Finders
|
5
5
|
module DynamicFinder
|
6
6
|
module Version
|
7
|
-
# Version finder using Body Pattern method.
|
7
|
+
# Version finder using Body Pattern method. Typically used when the response is not
|
8
8
|
# an HTML doc and Xpath can't be used
|
9
9
|
class BodyPattern < Finders::DynamicFinder::Version::Finder
|
10
10
|
# @return [ Hash ]
|
@@ -16,7 +16,7 @@ module WPScan
|
|
16
16
|
# @param [ Hash ] opts
|
17
17
|
# @return [ Version ]
|
18
18
|
def find(response, _opts = {})
|
19
|
-
return unless response.body =~ self.class::PATTERN
|
19
|
+
return unless response.code != 404 && response.body =~ self.class::PATTERN
|
20
20
|
|
21
21
|
create_version(
|
22
22
|
Regexp.last_match[:v],
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Typhoeus
|
4
|
+
# Custom Response class
|
5
|
+
class Response
|
6
|
+
# @note: Ignores requests done to the /status endpoint of the API
|
7
|
+
#
|
8
|
+
# @return [ Boolean ]
|
9
|
+
def from_vuln_api?
|
10
|
+
effective_url.start_with?(WPScan::DB::VulnApi.uri.to_s) && !effective_url.include?('/status')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/wpscan/version.rb
CHANGED
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.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WPScanTeam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-13 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.
|
19
|
+
version: 0.6.0
|
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.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 3.
|
173
|
+
version: 3.7.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.
|
180
|
+
version: 3.7.0
|
181
181
|
description: WPScan is a black box WordPress vulnerability scanner.
|
182
182
|
email:
|
183
183
|
- team@wpscan.org
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- app/controllers/enumeration/enum_methods.rb
|
199
199
|
- app/controllers/main_theme.rb
|
200
200
|
- app/controllers/password_attack.rb
|
201
|
+
- app/controllers/vuln_api.rb
|
201
202
|
- app/controllers/wp_version.rb
|
202
203
|
- app/finders.rb
|
203
204
|
- app/finders/config_backups.rb
|
@@ -296,6 +297,7 @@ files:
|
|
296
297
|
- app/views/cli/password_attack/users.erb
|
297
298
|
- app/views/cli/theme.erb
|
298
299
|
- app/views/cli/usage.erb
|
300
|
+
- app/views/cli/vuln_api/status.erb
|
299
301
|
- app/views/cli/vulnerability.erb
|
300
302
|
- app/views/cli/wp_item.erb
|
301
303
|
- app/views/cli/wp_version/version.erb
|
@@ -315,6 +317,7 @@ files:
|
|
315
317
|
- app/views/json/main_theme/theme.erb
|
316
318
|
- app/views/json/password_attack/users.erb
|
317
319
|
- app/views/json/theme.erb
|
320
|
+
- app/views/json/vuln_api/status.erb
|
318
321
|
- app/views/json/wp_item.erb
|
319
322
|
- app/views/json/wp_version/version.erb
|
320
323
|
- bin/wpscan
|
@@ -330,9 +333,11 @@ files:
|
|
330
333
|
- lib/wpscan/db/fingerprints.rb
|
331
334
|
- lib/wpscan/db/plugin.rb
|
332
335
|
- lib/wpscan/db/plugins.rb
|
336
|
+
- lib/wpscan/db/sponsor.rb
|
333
337
|
- lib/wpscan/db/theme.rb
|
334
338
|
- lib/wpscan/db/themes.rb
|
335
339
|
- lib/wpscan/db/updater.rb
|
340
|
+
- lib/wpscan/db/vuln_api.rb
|
336
341
|
- lib/wpscan/db/wp_item.rb
|
337
342
|
- lib/wpscan/db/wp_items.rb
|
338
343
|
- lib/wpscan/db/wp_version.rb
|
@@ -340,6 +345,7 @@ files:
|
|
340
345
|
- lib/wpscan/errors/enumeration.rb
|
341
346
|
- lib/wpscan/errors/http.rb
|
342
347
|
- lib/wpscan/errors/update.rb
|
348
|
+
- lib/wpscan/errors/vuln_api.rb
|
343
349
|
- lib/wpscan/errors/wordpress.rb
|
344
350
|
- lib/wpscan/errors/xmlrpc.rb
|
345
351
|
- lib/wpscan/finders.rb
|
@@ -362,6 +368,7 @@ files:
|
|
362
368
|
- lib/wpscan/target.rb
|
363
369
|
- lib/wpscan/target/platform/wordpress.rb
|
364
370
|
- lib/wpscan/target/platform/wordpress/custom_directories.rb
|
371
|
+
- lib/wpscan/typhoeus/response.rb
|
365
372
|
- lib/wpscan/version.rb
|
366
373
|
- lib/wpscan/vulnerability.rb
|
367
374
|
- lib/wpscan/vulnerable.rb
|