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 each others e.g: interesting files
Direct Known Subclasses
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 |
# File 'lib/cms_scanner/finders/independent_finders.rb', line 17 def run(opts = {}) each do |finder| symbols_from_mode(opts[:mode]).each do |symbol| [*finder.send(symbol, opts.merge(found: findings))].compact.each do |found| findings << found end end end findings end |
#symbols_from_mode(mode) ⇒ Array<Symbol>
Returns The symbols to call for the mode.
31 32 33 34 35 36 |
# File 'lib/cms_scanner/finders/independent_finders.rb', line 31 def symbols_from_mode(mode) symbols = [:passive, :aggressive] return symbols if mode.nil? || mode == :mixed symbols.include?(mode) ? [*mode] : [] end |