Class: CMSScanner::Finders::Finder
- Inherits:
-
Object
- Object
- CMSScanner::Finders::Finder
- Defined in:
- lib/cms_scanner/finders/finder.rb,
lib/cms_scanner/finders/finder/enumerator.rb,
lib/cms_scanner/finders/finder/fingerprinter.rb,
lib/cms_scanner/finders/finder/smart_url_checker.rb,
lib/cms_scanner/finders/finder/smart_url_checker/findings.rb
Overview
Finder
Direct Known Subclasses
InterestingFindings::FantasticoFileslist, InterestingFindings::Headers, InterestingFindings::RobotsTxt, InterestingFindings::SearchReplaceDB2, InterestingFindings::XMLRPC
Defined Under Namespace
Modules: Enumerator, Fingerprinter, SmartURLChecker
Constant Summary collapse
- DIRECT_ACCESS =
Constants for common found_by
'Direct Access (Aggressive Detection)'.freeze
Instance Attribute Summary collapse
-
#progress_bar ⇒ Object
Returns the value of attribute progress_bar.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #aggressive(_opts = {}) ⇒ Object
- #browser ⇒ Browser
- #create_progress_bar(opts = {}) ⇒ ProgressBar::Base, CMSScanner::MockedProgressBar
- #found_by(klass = self) ⇒ String
- #hydra ⇒ Typhoeus::Hydra
-
#initialize(target) ⇒ Finder
constructor
A new instance of Finder.
- #passive(_opts = {}) ⇒ Object
-
#titleize ⇒ String
The titleized name of the finder.
Constructor Details
#initialize(target) ⇒ Finder
Returns a new instance of Finder.
15 16 17 |
# File 'lib/cms_scanner/finders/finder.rb', line 15 def initialize(target) @target = target end |
Instance Attribute Details
#progress_bar ⇒ Object
Returns the value of attribute progress_bar.
13 14 15 |
# File 'lib/cms_scanner/finders/finder.rb', line 13 def @progress_bar end |
#target ⇒ Object
Returns the value of attribute target.
13 14 15 |
# File 'lib/cms_scanner/finders/finder.rb', line 13 def target @target end |
Instance Method Details
#aggressive(_opts = {}) ⇒ Object
28 |
# File 'lib/cms_scanner/finders/finder.rb', line 28 def aggressive(_opts = {}); end |
#browser ⇒ Browser
41 42 43 |
# File 'lib/cms_scanner/finders/finder.rb', line 41 def browser @browser ||= NS::Browser.instance end |
#create_progress_bar(opts = {}) ⇒ ProgressBar::Base, CMSScanner::MockedProgressBar
34 35 36 37 38 |
# File 'lib/cms_scanner/finders/finder.rb', line 34 def (opts = {}) klass = opts[:show_progression] ? ProgressBar : MockedProgressBar @progress_bar = klass.create({ format: '%t %a <%B> (%c / %C) %P%% %e' }.merge(opts)) end |
#found_by(klass = self) ⇒ String
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/cms_scanner/finders/finder.rb', line 52 def found_by(klass = self) caller_locations.each do |call| label = call.label next unless %w[aggressive passive].include? label return "#{klass.titleize} (#{label.capitalize} Detection)" end nil end |
#hydra ⇒ Typhoeus::Hydra
46 47 48 |
# File 'lib/cms_scanner/finders/finder.rb', line 46 def hydra @hydra ||= browser.hydra end |
#passive(_opts = {}) ⇒ Object
25 |
# File 'lib/cms_scanner/finders/finder.rb', line 25 def passive(_opts = {}); end |
#titleize ⇒ String
Returns The titleized name of the finder.
20 21 22 |
# File 'lib/cms_scanner/finders/finder.rb', line 20 def titleize self.class.to_s.demodulize.underscore.titleize end |