Sha256: c3966eb66995ed3f46d6a3d3ae1a6a1f0d76ef57d86b05b5785ffdd1a29135bb

Contents?: true

Size: 1.15 KB

Versions: 50

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module Medias
      # Medias Finder, see https://github.com/wpscanteam/wpscan/issues/172
      class AttachmentBruteForcing < CMSScanner::Finders::Finder
        include CMSScanner::Finders::Finder::Enumerator

        # @param [ Hash ] opts
        # @option opts [ Range ] :range Mandatory
        #
        # @return [ Array<Media> ]
        def aggressive(opts = {})
          found = []

          enumerate(target_urls(opts), opts) do |res|
            next unless res.code == 200

            found << Model::Media.new(res.effective_url, opts.merge(found_by: found_by, confidence: 100))
          end

          found
        end

        # @param [ Hash ] opts
        # @option opts [ Range ] :range Mandatory
        #
        # @return [ Hash ]
        def target_urls(opts = {})
          urls = {}

          opts[:range].each do |id|
            urls[target.uri.join("?attachment_id=#{id}").to_s] = id
          end

          urls
        end

        def create_progress_bar(opts = {})
          super(opts.merge(title: ' Brute Forcing Attachment IDs -'))
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

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