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

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

Overview

Medias Finder

Instance Method Summary collapse

Instance Method Details

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

Parameters:

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

Options Hash (opts):

  • :range (Range)

    Mandatory

Returns:



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

def aggressive(opts = {})
  found = []

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

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

  found
end

#create_progress_bar(opts = {}) ⇒ Object



38
39
40
# File 'app/finders/medias/attachment_brute_forcing.rb', line 38

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)


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

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

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

  urls
end