Sha256: 73c53872127c8a9fba6de0558455e623b3a65c4f2ce4e40d1c53389dbd034bcf

Contents?: true

Size: 1.52 KB

Versions: 12

Compression:

Stored size: 1.52 KB

Contents

module WPScan
  module Finders
    module InterestingFindings
      # Must Use Plugins Directory checker
      class MuPlugins < CMSScanner::Finders::Finder
        # @return [ InterestingFinding ]
        def passive(_opts = {})
          pattern = %r{#{target.content_dir}/mu\-plugins/}i

          target.in_scope_urls(target.homepage_res) do |url|
            next unless Addressable::URI.parse(url).path =~ pattern

            url = target.url('wp-content/mu-plugins/')

            return WPScan::InterestingFinding.new(
              url,
              confidence: 70,
              found_by: 'URLs In Homepage (Passive Detection)',
              to_s: "This site has 'Must Use Plugins': #{url}",
              references: { url: 'http://codex.wordpress.org/Must_Use_Plugins' }
            )
          end
          nil
        end

        # @return [ InterestingFinding ]
        def aggressive(_opts = {})
          url = target.url('wp-content/mu-plugins/')
          res = Browser.get_and_follow_location(url)

          return unless [200, 401, 403].include?(res.code)
          return if target.homepage_or_404?(res)
          # TODO: add the check for --exclude-content once implemented ?

          target.mu_plugins = true

          WPScan::InterestingFinding.new(
            url,
            confidence: 80,
            found_by: DIRECT_ACCESS,
            to_s: "This site has 'Must Use Plugins': #{url}",
            references: { url: 'http://codex.wordpress.org/Must_Use_Plugins' }
          )
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wpscan-3.2.1 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.2.0 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.1.0 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.8 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.7 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.6 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.5 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.4 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.3 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.2 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0.1 app/finders/interesting_findings/mu_plugins.rb
wpscan-3.0 app/finders/interesting_findings/mu_plugins.rb