# File lib/wpscan/wp_theme.rb, line 43 def self.find(target_uri) self.methods.grep(/find_from_/).each do |method_to_call| theme = self.send(method_to_call, target_uri) return theme if theme end nil end
# File lib/wpscan/wp_theme.rb, line 25 def initialize(name, options = {}) @name = name @vulns_xml = options[:vulns_xml] || DATA_DIR + '/wp_theme_vulns.xml' @vulns_xpath = "//theme[@name='#{@name}']/vulnerability" @style_url = options[:style_url] @version = options[:version] end
Discover the wordpress theme name by parsing the css link rel
# File lib/wpscan/wp_theme.rb, line 64 def self.find_from_css_link(target_uri) response = Browser.instance.get(target_uri.to_s, :follow_location => true, :max_redirects => 2) if matches = %{https?://[^"]+/themes/([^"]+)/style.css}.match(response.body) style_url = matches[0] theme_name = matches[1] return new(theme_name, :style_url => style_url) end end
code.google.com/p/wpscan/issues/detail?id=141
# File lib/wpscan/wp_theme.rb, line 76 def self.find_from_wooframework(target_uri) body = Browser.instance.get(target_uri.to_s).body regexp = %{<meta name="generator" content="([^\s"]+)\s?([^"]+)?" />\s+<meta name="generator" content="WooFramework\s?([^"]+)?" />} if matches = regexp.match(body) woo_theme_name = matches[1] woo_theme_version = matches[2] woo_framework_version = matches[3] # Not used at this time return new(woo_theme_name, :version => woo_theme_version) end end
Generated with the Darkfish Rdoc Generator 2.