Class: CMSScanner::Finders::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/cms_scanner/finders/finder.rb,
lib/cms_scanner/finders/finder/enumerator.rb,
lib/cms_scanner/finders/finder/smart_url_checker.rb,
lib/cms_scanner/finders/finder/smart_url_checker/findings.rb

Overview

Finder

Defined Under Namespace

Modules: Enumerator, SmartURLChecker

Constant Summary collapse

DIRECT_ACCESS =

Constants for common found_by

'Direct Access (Aggressive Detection)'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Finder

Returns a new instance of Finder.



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

def initialize(target)
  @target = target
end

Instance Attribute Details

#targetObject

Returns the value of attribute target.



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

def target
  @target
end

Instance Method Details

#aggressive(_opts = {}) ⇒ Object

Parameters:

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


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

def aggressive(_opts = {})
end

#found_byObject



39
40
41
42
43
44
45
46
47
# File 'lib/cms_scanner/finders/finder.rb', line 39

def found_by
  caller_locations.each do |call|
    label = call.label

    next unless label == 'aggressive' || label == 'passive'

    return "#{titleize} (#{label.capitalize} Detection)"
  end
end

#passive(_opts = {}) ⇒ Object

Parameters:

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


23
24
# File 'lib/cms_scanner/finders/finder.rb', line 23

def passive(_opts = {})
end

#progress_bar(total, title = '', format = '%t %a <%B> (%c / %C) %P%% %e') ⇒ ProgressBar

Parameters:

Returns:

  • (ProgressBar)


35
36
37
# File 'lib/cms_scanner/finders/finder.rb', line 35

def progress_bar(total, title = '', format = '%t %a <%B> (%c / %C) %P%% %e')
  ProgressBar.create(total: total, title: title, format: format)
end

#titleizeString

Returns The titleize name of the finder.

Returns:

  • (String)

    The titleize name of the finder



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

def titleize
  self.class.to_s.demodulize.underscore.titleize
end