Class: WPScan::Finders::DynamicFinder::WpItemVersion::QueryParameter

Inherits:
Version::QueryParameter show all
Defined in:
lib/wpscan/finders/dynamic_finder/wp_item_version.rb

Instance Method Summary collapse

Methods inherited from Version::QueryParameter

child_class_constants, #find, #scan_response

Methods inherited from Finder

#aggressive, child_class_constant, child_class_constants, create_child_class, #find, #passive

Instance Method Details

#path_patternRegexp

Returns:

  • (Regexp)


24
25
26
27
28
29
30
31
# File 'lib/wpscan/finders/dynamic_finder/wp_item_version.rb', line 24

def path_pattern
  # TODO: consider the target.blog.themes_dir if the target is a Theme (maybe implement a WpItem#item_dir ?)
  @path_pattern ||= %r{
    #{Regexp.escape(target.blog.plugins_dir)}/
    #{Regexp.escape(target.slug)}/
    (?:#{self.class::FILES.join('|')})\z
  }ix
end

#xpathObject



33
34
35
36
37
# File 'lib/wpscan/finders/dynamic_finder/wp_item_version.rb', line 33

def xpath
  @xpath ||= self.class::XPATH ||
             "//link[contains(@href,'#{target.slug}')]/@href" \
             "|//script[contains(@src,'#{target.slug}')]/@src"
end