Class: WPScan::Model::BackupFolder

Inherits:
InterestingFinding show all
Defined in:
app/models/backup_folder.rb

Overview

BackupFolder

Constant Summary collapse

MAX_ENTRIES_DISPLAY =
10

Constants included from Finders::Finding

Finders::Finding::FINDING_OPTS

Instance Attribute Summary

Attributes inherited from InterestingFinding

#url

Instance Method Summary collapse

Methods inherited from InterestingFinding

#==, #entries, #initialize, #type

Methods included from References

#cve_url, #cve_urls, #cves, #exploitdb_ids, #exploitdb_url, #exploitdb_urls, #msf_modules, #msf_url, #msf_urls, #packetstorm_ids, #packetstorm_url, #packetstorm_urls, #references, #references=, #references_urls, #securityfocus_ids, #securityfocus_url, #securityfocus_urls, #urls, #wpvulndb_ids, #wpvulndb_url, #wpvulndb_urls, #youtube_url, #youtube_urls

Methods included from Finders::Finding

#<=>, #confidence, #confidence=, #confirmed_by, #eql?, included, #parse_finding_options

Constructor Details

This class inherits a constructor from WPScan::Model::InterestingFinding

Instance Method Details

#interesting_entriesArray<String>

Limit displayed entries to avoid overwhelming output

Returns:

  • (Array<String>)


28
29
30
31
32
33
34
35
36
# File 'app/models/backup_folder.rb', line 28

def interesting_entries
  return [] unless @interesting_entries

  entries = @interesting_entries.first(MAX_ENTRIES_DISPLAY)
  if @interesting_entries.size > MAX_ENTRIES_DISPLAY
    entries << "... and #{@interesting_entries.size - MAX_ENTRIES_DISPLAY} more"
  end
  entries
end

#severitySymbol

Returns:

  • (Symbol)


20
21
22
23
24
# File 'app/models/backup_folder.rb', line 20

def severity
  return :high if interesting_entries&.any?

  :medium
end

#to_sString

Returns:

  • (String)


10
11
12
13
14
15
16
17
# File 'app/models/backup_folder.rb', line 10

def to_s
  msg = "Backup folder found: #{url}"
  if interesting_entries&.any?
    total = @interesting_entries.size
    msg += " (#{total} #{total == 1 ? 'entry' : 'entries'})"
  end
  msg
end