Class: WPScan::Finders::ConfigBackups::KnownFilenames
- Inherits:
-
CMSScanner::Finders::Finder
- Object
- CMSScanner::Finders::Finder
- WPScan::Finders::ConfigBackups::KnownFilenames
- Includes:
- CMSScanner::Finders::Finder::Enumerator
- Defined in:
- app/finders/config_backups/known_filenames.rb
Overview
Config Backup finder
Instance Method Summary collapse
- #aggressive(opts = {}) ⇒ Array<ConfigBackup>
- #create_progress_bar(opts = {}) ⇒ Object
- #potential_urls(opts = {}) ⇒ Hash
Instance Method Details
#aggressive(opts = {}) ⇒ Array<ConfigBackup>
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/finders/config_backups/known_filenames.rb', line 15 def aggressive(opts = {}) found = [] enumerate(potential_urls(opts), opts.merge(check_full_response: 200)) do |res| next unless res.body =~ /define/i && res.body !~ /<\s?html/i found << Model::ConfigBackup.new(res.request.url, found_by: DIRECT_ACCESS, confidence: 100) end found end |
#create_progress_bar(opts = {}) ⇒ Object
41 42 43 |
# File 'app/finders/config_backups/known_filenames.rb', line 41 def (opts = {}) super(opts.merge(title: ' Checking Config Backups -')) end |
#potential_urls(opts = {}) ⇒ Hash
31 32 33 34 35 36 37 38 39 |
# File 'app/finders/config_backups/known_filenames.rb', line 31 def potential_urls(opts = {}) urls = {} File.open(opts[:list]).each_with_index do |file, index| urls[target.url(file.chomp)] = index end urls end |