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>
19 20 21 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 19 def self.allowed_classes @allowed_classes ||= i[Comment Xpath HeaderPattern BodyPattern JavascriptVar QueryParameter ConfigParser] end |
.db_data ⇒ Hash
13 14 15 16 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 13 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
8 9 10 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 8 def self.db_file @db_file ||= DB_DIR.join('dynamic_finders.yml').to_s end |
.method_missing(sym) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 24 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
37 38 39 |
# File 'lib/wpscan/db/dynamic_finders/base.rb', line 37 def self.respond_to_missing?(sym, *_args) sym =~ /\A(passive|aggressive)_(.*)_finder_configs\z/i end |