Sha256: c605a3c926c0950ddc94ba57f10337038f83c14d1bea73645ebf303f7a140546

Contents?: true

Size: 1.07 KB

Versions: 22

Compression:

Stored size: 1.07 KB

Contents

module WPScan
  module Finders
    module ThemeVersion
      # Theme Version Finder from the style.css file
      class Style < CMSScanner::Finders::Finder
        # @param [ Hash ] opts
        #
        # @return [ Version ]
        def passive(_opts = {})
          return unless cached_style?

          style_version
        end

        # @param [ Hash ] opts
        #
        # @return [ Version ]
        def aggressive(_opts = {})
          return if cached_style?

          style_version
        end

        # @return [ Boolean ]
        def cached_style?
          Typhoeus::Config.cache.get(browser.forge_request(target.style_url)) ? true : false
        end

        # @return [ Version ]
        def style_version
          return unless Browser.get(target.style_url).body =~ /Version:[\t ]*(?!trunk)([0-9a-z\.-]+)/i

          WPScan::Version.new(
            Regexp.last_match[1],
            found_by: found_by,
            confidence: 80,
            interesting_entries: ["#{target.style_url}, Match: '#{Regexp.last_match}'"]
          )
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
wpscan-3.4.5 app/finders/theme_version/style.rb
wpscan-3.4.4 app/finders/theme_version/style.rb
wpscan-3.4.3 app/finders/theme_version/style.rb
wpscan-3.4.2 app/finders/theme_version/style.rb
wpscan-3.4.1 app/finders/theme_version/style.rb
wpscan-3.4.0 app/finders/theme_version/style.rb
wpscan-3.3.3 app/finders/theme_version/style.rb
wpscan-3.3.2 app/finders/theme_version/style.rb
wpscan-3.3.1 app/finders/theme_version/style.rb
wpscan-3.3.0 app/finders/theme_version/style.rb
wpscan-3.2.1 app/finders/theme_version/style.rb
wpscan-3.2.0 app/finders/theme_version/style.rb
wpscan-3.1.0 app/finders/theme_version/style.rb
wpscan-3.0.8 app/finders/theme_version/style.rb
wpscan-3.0.7 app/finders/theme_version/style.rb
wpscan-3.0.6 app/finders/theme_version/style.rb
wpscan-3.0.5 app/finders/theme_version/style.rb
wpscan-3.0.4 app/finders/theme_version/style.rb
wpscan-3.0.3 app/finders/theme_version/style.rb
wpscan-3.0.2 app/finders/theme_version/style.rb