# frozen_string_literal: true12module WPScan3module Finders4module Plugins5# Plugins finder from Dynamic Finder 'BodyPattern'6class BodyPattern < Finders::DynamicFinder::WpItems::Finder7DEFAULT_CONFIDENCE = 3089# @param [ Hash ] opts The options from the #passive, #aggressive methods10# @param [ Typhoeus::Response ] response11# @param [ String ] slug12# @param [ String ] klass13# @param [ Hash ] config The related dynamic finder config hash14#15# @return [ Plugin ] The detected plugin in the response, related to the config16def process_response(opts, response, slug, klass, config)17return unless response.body&.match?(config['pattern'])1819Model::Plugin.new(20slug,21target,22opts.merge(found_by: found_by(klass), confidence: config['confidence'] || DEFAULT_CONFIDENCE)23)24end25end26end27end28end293031