Sha256: f04e4d116ba59adbfb3cd9cb5259dff8259c3f7318a7e8db9ea78ddedb5ee773

Contents?: true

Size: 1.23 KB

Versions: 50

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module ConfigBackups
      # Config Backup finder
      class KnownFilenames < CMSScanner::Finders::Finder
        include CMSScanner::Finders::Finder::Enumerator

        # @param [ Hash ] opts
        # @option opts [ String ] :list
        # @option opts [ Boolean ] :show_progression
        #
        # @return [ Array<ConfigBackup> ]
        def aggressive(opts = {})
          found = []

          enumerate(potential_urls(opts), opts.merge(check_full_response: 200)) do |res|
            next unless res.body =~ /define/i && res.body !~ /<\s?html/i

            found << Model::ConfigBackup.new(res.request.url, found_by: DIRECT_ACCESS, confidence: 100)
          end

          found
        end

        # @param [ Hash ] opts
        # @option opts [ String ] :list Mandatory
        #
        # @return [ Hash ]
        def potential_urls(opts = {})
          urls = {}

          File.open(opts[:list]).each_with_index do |file, index|
            urls[target.url(file.chomp)] = index
          end

          urls
        end

        def create_progress_bar(opts = {})
          super(opts.merge(title: ' Checking Config Backups -'))
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
wpscan-3.8.28 app/finders/config_backups/known_filenames.rb
wpscan-3.8.27 app/finders/config_backups/known_filenames.rb
wpscan-3.8.26 app/finders/config_backups/known_filenames.rb
wpscan-3.8.25 app/finders/config_backups/known_filenames.rb
wpscan-3.8.24 app/finders/config_backups/known_filenames.rb
wpscan-3.8.22 app/finders/config_backups/known_filenames.rb
wpscan-3.8.21 app/finders/config_backups/known_filenames.rb
wpscan-3.8.20 app/finders/config_backups/known_filenames.rb
wpscan-3.8.19 app/finders/config_backups/known_filenames.rb
wpscan-3.8.18 app/finders/config_backups/known_filenames.rb
wpscan-3.8.17 app/finders/config_backups/known_filenames.rb
wpscan-3.8.16 app/finders/config_backups/known_filenames.rb
wpscan-3.8.15 app/finders/config_backups/known_filenames.rb
wpscan-3.8.14 app/finders/config_backups/known_filenames.rb
wpscan-3.8.13 app/finders/config_backups/known_filenames.rb
wpscan-3.8.12 app/finders/config_backups/known_filenames.rb
wpscan-3.8.11 app/finders/config_backups/known_filenames.rb
wpscan-3.8.10 app/finders/config_backups/known_filenames.rb
wpscan-3.8.9 app/finders/config_backups/known_filenames.rb
wpscan-3.8.8 app/finders/config_backups/known_filenames.rb