Sha256: 90eb4f9efe3f041eba16da302f0a5bbf47308e378629ffb0c5bb809f62230322

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

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

          Model::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

25 entries across 25 versions & 1 rubygems

Version Path
wpscan-3.8.2 app/finders/theme_version/style.rb
wpscan-3.8.1 app/finders/theme_version/style.rb
wpscan-3.8.0 app/finders/theme_version/style.rb
wpscan-3.7.11 app/finders/theme_version/style.rb
wpscan-3.7.10 app/finders/theme_version/style.rb
wpscan-3.7.9 app/finders/theme_version/style.rb
wpscan-3.7.8 app/finders/theme_version/style.rb
wpscan-3.7.7 app/finders/theme_version/style.rb
wpscan-3.7.6 app/finders/theme_version/style.rb
wpscan-3.7.5 app/finders/theme_version/style.rb
wpscan-3.7.4 app/finders/theme_version/style.rb
wpscan-3.7.3 app/finders/theme_version/style.rb
wpscan-3.7.2 app/finders/theme_version/style.rb
wpscan-3.7.1 app/finders/theme_version/style.rb
wpscan-3.7.0 app/finders/theme_version/style.rb
wpscan-3.6.3 app/finders/theme_version/style.rb
wpscan-3.6.2 app/finders/theme_version/style.rb
wpscan-3.6.1 app/finders/theme_version/style.rb
wpscan-3.6.0 app/finders/theme_version/style.rb
wpscan-3.5.5 app/finders/theme_version/style.rb