Module: CMSScanner::Finders::Finder::SmartURLChecker

Defined in:
lib/cms_scanner/finders/finder/smart_url_checker.rb,
lib/cms_scanner/finders/finder/smart_url_checker/findings.rb

Overview

Smart URL Checker

Defined Under Namespace

Classes: Findings

Instance Method Summary collapse

Instance Method Details

#aggressive(opts = {}) ⇒ Array<Finding>

Parameters:

  • opts (Hash) (defaults to: {})

Returns:



38
39
40
41
42
43
44
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 38

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

#aggressive_urls(_opts = {}) ⇒ Array<String>

Parameters:

  • opts (Hash)

Returns:

  • (Array<String>)


49
50
51
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 49

def aggressive_urls(_opts = {})
  fail NotImplementedError
end

#passive(opts = {}) ⇒ Array<Finding>

Parameters:

  • opts (Hash) (defaults to: {})

Returns:



19
20
21
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 19

def passive(opts = {})
  process_urls(passive_urls(opts), opts)
end

#passive_urls(_opts = {}) ⇒ Array<String>

Parameters:

  • opts (Hash)

Returns:

  • (Array<String>)


26
27
28
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 26

def passive_urls(_opts = {})
  target.in_scope_urls(NS::Browser.get_and_follow_location(target.url), passive_urls_xpath)
end

#passive_urls_xpathString

Returns:

  • (String)


31
32
33
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 31

def passive_urls_xpath
  fail NotImplementedError
end

#process_urls(_urls, _opts = {}) ⇒ Object

Returns [].

Parameters:

  • urls (Array<String>)
  • opts (Hash)

Returns:



12
13
14
# File 'lib/cms_scanner/finders/finder/smart_url_checker.rb', line 12

def process_urls(_urls, _opts = {})
  fail NotImplementedError
end