Sha256: ba077f289273d9e15a84254567047ca36591d0906f9958099ea8b2509dc6d4a6

Contents?: true

Size: 1.21 KB

Versions: 12

Compression:

Stored size: 1.21 KB

Contents

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<InterestingFinding> ]
        def aggressive(opts = {})
          found = []

          enumerate(potential_urls(opts), opts) do |res|
            # Might need to improve that
            next unless res.body =~ /define/i && res.body !~ /<\s?html/i

            found << WPScan::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

12 entries across 12 versions & 1 rubygems

Version Path
wpscan-3.2.1 app/finders/config_backups/known_filenames.rb
wpscan-3.2.0 app/finders/config_backups/known_filenames.rb
wpscan-3.1.0 app/finders/config_backups/known_filenames.rb
wpscan-3.0.8 app/finders/config_backups/known_filenames.rb
wpscan-3.0.7 app/finders/config_backups/known_filenames.rb
wpscan-3.0.6 app/finders/config_backups/known_filenames.rb
wpscan-3.0.5 app/finders/config_backups/known_filenames.rb
wpscan-3.0.4 app/finders/config_backups/known_filenames.rb
wpscan-3.0.3 app/finders/config_backups/known_filenames.rb
wpscan-3.0.2 app/finders/config_backups/known_filenames.rb
wpscan-3.0.1 app/finders/config_backups/known_filenames.rb
wpscan-3.0 app/finders/config_backups/known_filenames.rb