Skip to content

Commit

Permalink
Merge pull request #1787 from 0n1shi/fix/db-exports-not-detected
Browse files Browse the repository at this point in the history
Fixed #1759
  • Loading branch information
alexsanford authored Oct 14, 2023
2 parents a423b15 + 2c1eb27 commit bce3b48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/finders/db_exports/known_locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module DbExports
class KnownLocations < CMSScanner::Finders::Finder
include CMSScanner::Finders::Finder::Enumerator

def valid_response_codes
@valid_response_codes ||= [200, 206].freeze
end

SQL_PATTERN = /(?:DROP|(?:UN)?LOCK|CREATE|ALTER) (?:TABLE|DATABASE)|INSERT INTO/.freeze

# @param [ Hash ] opts
Expand All @@ -17,7 +21,7 @@ class KnownLocations < CMSScanner::Finders::Finder
def aggressive(opts = {})
found = []

enumerate(potential_urls(opts), opts.merge(check_full_response: 200)) do |res|
enumerate(potential_urls(opts), opts.merge(check_full_response: valid_response_codes)) do |res|
if res.effective_url.end_with?('.zip')
next unless %r{\Aapplication/zip}i.match?(res.headers['Content-Type'])
else
Expand Down

0 comments on commit bce3b48

Please sign in to comment.