Class: WPScan::Finders::WpVersion::Readme
- Defined in:
- app/finders/wp_version/readme.rb
Overview
Readme Version Finder
Constant Summary
Constants inherited from Finder
Instance Attribute Summary
Attributes inherited from Finder
Instance Method Summary collapse
Methods inherited from Finder
#browser, #create_progress_bar, #found_by, #hydra, #initialize, #passive, #titleize
Constructor Details
This class inherits a constructor from WPScan::Finders::Finder
Instance Method Details
#aggressive(_opts = {}) ⇒ WpVersion
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/finders/wp_version/readme.rb', line 9 def aggressive(_opts = {}) readme_url = target.url('readme.html') # Maybe move this into the Target ? node = Browser.get(readme_url).html.css('h1#logo').last return unless node&.text.to_s.strip =~ /\AVersion (.*)\z/i number = Regexp.last_match(1) return unless Model::WpVersion.valid?(number) Model::WpVersion.new( number, found_by: 'Readme (Aggressive Detection)', # Since WP 4.7, the Readme only contains the major version (ie 4.7, 4.8 etc) confidence: number >= '4.7' ? 10 : 90, interesting_entries: ["#{readme_url}, Match: '#{node.text.to_s.strip}'"] ) end |