Merges with Master (and solves conflicts)
This commit is contained in:
@@ -6,7 +6,9 @@ module WPScan
|
||||
# DB Exports finder
|
||||
# See https://github.com/wpscanteam/wpscan-v3/issues/62
|
||||
class KnownLocations < CMSScanner::Finders::Finder
|
||||
include CMSScanner::Finders::Finder::Enumerator
|
||||
include Finders::Finder::Enumerator
|
||||
|
||||
SQL_PATTERN = /(?:DROP|(?:UN)?LOCK|CREATE) TABLE|INSERT INTO/.freeze
|
||||
|
||||
# @param [ Hash ] opts
|
||||
# @option opts [ String ] :list
|
||||
@@ -17,16 +19,21 @@ module WPScan
|
||||
found = []
|
||||
|
||||
enumerate(potential_urls(opts), opts) do |res|
|
||||
next unless res.code == 200 && res.body =~ /INSERT INTO/
|
||||
|
||||
found << Model::DbExport.new(res.request.url,
|
||||
found_by: DIRECT_ACCESS,
|
||||
confidence: 100)
|
||||
found << Model::DbExport.new(res.request.url, found_by: DIRECT_ACCESS, confidence: 100)
|
||||
end
|
||||
|
||||
found
|
||||
end
|
||||
|
||||
def valid_response?(res, _exclude_content = nil)
|
||||
return false unless res.code == 200
|
||||
|
||||
return true if res.effective_url.end_with?('.zip') &&
|
||||
res.headers['Content-Type'] =~ %r{\Aapplication/zip}i
|
||||
|
||||
Browser.get(res.effective_url, headers: { 'Range' => 'bytes=0-3000' }).body =~ SQL_PATTERN ? true : false
|
||||
end
|
||||
|
||||
# @param [ Hash ] opts
|
||||
# @option opts [ String ] :list Mandatory
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user