Class: WPScan::DB::DynamicFinders::Base
- Inherits:
-
Object
- Object
- WPScan::DB::DynamicFinders::Base
- Defined in:
- lib/wpscan/db/dynamic_finders/base.rb
Class Method Summary collapse
- .allowed_classes ⇒ Array<Symbol>
- .db_data ⇒ Hash
- .db_file ⇒ String
- .method_missing(sym) ⇒ Object
- .respond_to_missing?(sym, *_args) ⇒ Boolean
Class Method Details
.allowed_classes ⇒ Array<Symbol>
17 18 19 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 17 def self.allowed_classes @allowed_classes ||= %i[Comment Xpath HeaderPattern BodyPattern JavascriptVar QueryParameter ConfigParser] end |
.db_data ⇒ Hash
11 12 13 14 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 11 def self.db_data # true allows aliases to be loaded @db_data ||= YAML.safe_load(File.read(db_file), [Regexp], [], true) end |
.db_file ⇒ String
6 7 8 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 6 def self.db_file @db_file ||= File.join(DB_DIR, 'dynamic_finders.yml') end |
.method_missing(sym) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 22 def self.method_missing(sym) super unless sym =~ /\A(passive|aggressive)_(.*)_finder_configs\z/i finder_class = Regexp.last_match[2].camelize.to_sym raise "#{finder_class} is not allowed as a Dynamic Finder" unless allowed_classes.include?(finder_class) finder_configs( finder_class, Regexp.last_match[1] == 'aggressive' ) end |
.respond_to_missing?(sym, *_args) ⇒ Boolean
35 36 37 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 35 def self.respond_to_missing?(sym, *_args) sym =~ /\A(passive|aggressive)_(.*)_finder_configs\z/i end |