Class: CMSScanner::Finders::IndependentFinders
- Inherits:
-
Array
- Object
- Array
- CMSScanner::Finders::IndependentFinders
- Defined in:
- lib/cms_scanner/finders/independent_finders.rb
Overview
Independent Finders container This class is designed to handle independent results which are not related with others e.g: interesting files
Instance Method Summary collapse
- #findings ⇒ Findings
- #run(opts = {}) ⇒ Findings
-
#symbols_from_mode(mode) ⇒ Array<Symbol>
The symbols to call for the mode.
Instance Method Details
#findings ⇒ Findings
9 10 11 |
# File 'lib/cms_scanner/finders/independent_finders.rb', line 9 def findings @findings ||= NS::Finders::Findings.new end |
#run(opts = {}) ⇒ Findings
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cms_scanner/finders/independent_finders.rb', line 17 def run(opts = {}) each do |finder| symbols_from_mode(opts[:mode]).each do |symbol| r = finder.send(symbol, opts) next unless r findings + [*r] end end findings end |
#symbols_from_mode(mode) ⇒ Array<Symbol>
Returns The symbols to call for the mode.
33 34 35 36 37 38 |
# File 'lib/cms_scanner/finders/independent_finders.rb', line 33 def symbols_from_mode(mode) symbols = [:passive, :aggressive] return symbols if mode.nil? || mode == :mixed symbols.include?(mode) ? [*mode] : [] end |