Class: WPScan::Finders::Medias::AttachmentBruteForcing

Inherits:
Finder
  • Object
show all
Includes:
Finder::Enumerator
Defined in:
app/finders/medias/attachment_brute_forcing.rb

Overview

Constant Summary

Constants inherited from Finder

Finder::DIRECT_ACCESS

Instance Attribute Summary

Attributes inherited from Finder

#progress_bar, #target

Instance Method Summary collapse

Methods included from Finder::Enumerator

#enumerate, #full_request_params, #head_or_get_request_params, #maybe_get_full_response, #valid_response_codes

Methods inherited from Finder

#browser, #found_by, #hydra, #initialize, #passive, #titleize

Constructor Details

This class inherits a constructor from WPScan::Finders::Finder

Instance Method Details

#aggressive(opts = {}) ⇒ Array<Media>

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :range (Range)

    Mandatory

Returns:

  • (Array<Media>)


14
15
16
17
18
19
20
21
22
23
24
# File 'app/finders/medias/attachment_brute_forcing.rb', line 14

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

#create_progress_bar(opts = {}) ⇒ Object



40
41
42
# File 'app/finders/medias/attachment_brute_forcing.rb', line 40

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

#target_urls(opts = {}) ⇒ Hash

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :range (Range)

    Mandatory

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
38
# File 'app/finders/medias/attachment_brute_forcing.rb', line 30

def target_urls(opts = {})
  urls = {}

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

  urls
end