Sha256: 8d68f9a47dec3aba61173a42629f2a515dbd6e1fe5ebd54e89cf7f7a81c50b94

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

require 'cms_scanner/finders/finder/smart_url_checker/findings'

module CMSScanner
  module Finders
    class Finder
      # Smart URL Checker
      module SmartURLChecker
        # @param [ Array<String> ] urls
        # @param [ Hash ] opts
        #
        # @return []
        def process_urls(_urls, _opts = {})
          raise NotImplementedError
        end

        # @param [ Hash ] opts
        #
        # @return [ Array<Finding> ]
        def passive(opts = {})
          process_urls(passive_urls(opts), opts)
        end

        # @param [ Hash ] opts
        #
        # @return [ Array<String> ]
        def passive_urls(_opts = {})
          target.in_scope_urls(target.homepage_res, passive_urls_xpath)
        end

        # @return [ String ]
        def passive_urls_xpath
          raise NotImplementedError
        end

        # @param [ Hash ] opts
        #
        # @return [ Array<Finding> ]
        def aggressive(opts = {})
          # To avoid scanning the same twice
          urls = aggressive_urls(opts)
          urls -= passive_urls(opts) if opts[:mode] == :mixed

          process_urls(urls, opts)
        end

        # @param [ Hash ] opts
        #
        # @return [ Array<String> ]
        def aggressive_urls(_opts = {})
          raise NotImplementedError
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cms_scanner-0.0.38.4 lib/cms_scanner/finders/finder/smart_url_checker.rb
cms_scanner-0.0.38.3 lib/cms_scanner/finders/finder/smart_url_checker.rb
cms_scanner-0.0.38.2 lib/cms_scanner/finders/finder/smart_url_checker.rb
cms_scanner-0.0.38.1 lib/cms_scanner/finders/finder/smart_url_checker.rb
cms_scanner-0.0.38.0 lib/cms_scanner/finders/finder/smart_url_checker.rb