HELLO v3!!!
This commit is contained in:
40
app/finders/wp_version/atom_generator.rb
Normal file
40
app/finders/wp_version/atom_generator.rb
Normal file
@@ -0,0 +1,40 @@
|
||||
module WPScan
|
||||
module Finders
|
||||
module WpVersion
|
||||
# Atom Generator Version Finder
|
||||
class AtomGenerator < CMSScanner::Finders::Finder
|
||||
include Finder::WpVersion::SmartURLChecker
|
||||
|
||||
def process_urls(urls, _opts = {})
|
||||
found = Findings.new
|
||||
|
||||
urls.each do |url|
|
||||
res = Browser.get_and_follow_location(url)
|
||||
|
||||
res.html.css('generator').each do |node|
|
||||
next unless node.text.to_s.strip.casecmp('wordpress').zero?
|
||||
|
||||
found << create_version(
|
||||
node['version'],
|
||||
found_by: found_by,
|
||||
entries: ["#{res.effective_url}, #{node.to_s.strip}"]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
found
|
||||
end
|
||||
|
||||
def passive_urls_xpath
|
||||
'//link[@rel="alternate" and @type="application/atom+xml"]/@href'
|
||||
end
|
||||
|
||||
def aggressive_urls(_opts = {})
|
||||
%w[feed/atom/ ?feed=atom].reduce([]) do |a, uri|
|
||||
a << target.url(uri)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
38
app/finders/wp_version/rdf_generator.rb
Normal file
38
app/finders/wp_version/rdf_generator.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
module WPScan
|
||||
module Finders
|
||||
module WpVersion
|
||||
# RDF Generator Version Finder
|
||||
class RDFGenerator < CMSScanner::Finders::Finder
|
||||
include Finder::WpVersion::SmartURLChecker
|
||||
|
||||
def process_urls(urls, _opts = {})
|
||||
found = Findings.new
|
||||
|
||||
urls.each do |url|
|
||||
res = Browser.get_and_follow_location(url)
|
||||
|
||||
res.html.xpath('//generatoragent').each do |node|
|
||||
next unless node['rdf:resource'] =~ %r{\Ahttps?://wordpress\.(?:[a-z.]+)/\?v=(.*)\z}i
|
||||
|
||||
found << create_version(
|
||||
Regexp.last_match[1],
|
||||
found_by: found_by,
|
||||
entries: ["#{res.effective_url}, #{node.to_s.strip}"]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
found
|
||||
end
|
||||
|
||||
def passive_urls_xpath
|
||||
'//a[contains(@href, "rdf")]/@href'
|
||||
end
|
||||
|
||||
def aggressive_urls(_opts = {})
|
||||
[target.url('feed/rdf/')]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
29
app/finders/wp_version/readme.rb
Normal file
29
app/finders/wp_version/readme.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
module WPScan
|
||||
module Finders
|
||||
module WpVersion
|
||||
# Readme Version Finder
|
||||
class Readme < CMSScanner::Finders::Finder
|
||||
# @return [ WpVersion ]
|
||||
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 WPScan::WpVersion.valid?(number)
|
||||
|
||||
WPScan::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
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
43
app/finders/wp_version/rss_generator.rb
Normal file
43
app/finders/wp_version/rss_generator.rb
Normal file
@@ -0,0 +1,43 @@
|
||||
module WPScan
|
||||
module Finders
|
||||
module WpVersion
|
||||
# RSS Generator Version Finder
|
||||
class RSSGenerator < CMSScanner::Finders::Finder
|
||||
include Finder::WpVersion::SmartURLChecker
|
||||
|
||||
def process_urls(urls, _opts = {})
|
||||
found = Findings.new
|
||||
|
||||
urls.each do |url|
|
||||
res = Browser.get_and_follow_location(url)
|
||||
|
||||
res.html.xpath('//comment()[contains(., "wordpress")] | //generator').each do |node|
|
||||
node_text = node.text.to_s.strip
|
||||
|
||||
next unless node_text =~ %r{\Ahttps?://wordpress\.(?:[a-z]+)/\?v=(.*)\z}i ||
|
||||
node_text =~ %r{\Agenerator="wordpress/([^"]+)"\z}i
|
||||
|
||||
found << create_version(
|
||||
Regexp.last_match[1],
|
||||
found_by: found_by,
|
||||
entries: ["#{res.effective_url}, #{node.to_s.strip}"]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
found
|
||||
end
|
||||
|
||||
def passive_urls_xpath
|
||||
'//link[@rel="alternate" and @type="application/rss+xml"]/@href'
|
||||
end
|
||||
|
||||
def aggressive_urls(_opts = {})
|
||||
%w[feed/ comments/feed/ feed/rss/ feed/rss2/].reduce([]) do |a, uri|
|
||||
a << target.url(uri)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
30
app/finders/wp_version/unique_fingerprinting.rb
Normal file
30
app/finders/wp_version/unique_fingerprinting.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
module WPScan
|
||||
module Finders
|
||||
module WpVersion
|
||||
# Unique Fingerprinting Version Finder
|
||||
class UniqueFingerprinting < CMSScanner::Finders::Finder
|
||||
include CMSScanner::Finders::Finder::Fingerprinter
|
||||
|
||||
# @return [ WpVersion ]
|
||||
def aggressive(opts = {})
|
||||
fingerprint(DB::Fingerprints.wp_unique_fingerprints, opts) do |version_number, url, md5sum|
|
||||
hydra.abort
|
||||
progress_bar.finish
|
||||
|
||||
return WPScan::WpVersion.new(
|
||||
version_number,
|
||||
found_by: 'Unique Fingerprinting (Aggressive Detection)',
|
||||
confidence: 100,
|
||||
interesting_entries: ["#{url} md5sum is #{md5sum}"]
|
||||
)
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
def create_progress_bar(opts = {})
|
||||
super(opts.merge(title: 'Fingerprinting the version -'))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user