Path: blob/master/app/finders/interesting_findings/mu_plugins.rb
485 views
# frozen_string_literal: true12module WPScan3module Finders4module InterestingFindings5# Must Use Plugins Directory checker6class MuPlugins < CMSScanner::Finders::Finder7# @return [ InterestingFinding ]8def passive(_opts = {})9pattern = %r{#{target.content_dir}/mu-plugins/}i1011target.in_scope_uris(target.homepage_res, '(//@href|//@src)[contains(., "mu-plugins")]') do |uri|12next unless uri.path&.match?(pattern)1314url = target.url('wp-content/mu-plugins/')1516target.mu_plugins = true1718return Model::MuPlugins.new(url, confidence: 70, found_by: 'URLs In Homepage (Passive Detection)')19end20nil21end2223# @return [ InterestingFinding ]24def aggressive(_opts = {})25url = target.url('wp-content/mu-plugins/')26res = Browser.get_and_follow_location(url)2728return unless [200, 401, 403].include?(res.code)29return if target.homepage_or_404?(res)3031target.mu_plugins = true3233Model::MuPlugins.new(url, confidence: 80, found_by: DIRECT_ACCESS)34end35end36end37end38end394041