Changes some DF method names to avoid confusion with db ones
This commit is contained in:
@@ -31,7 +31,7 @@ module WPScan
|
|||||||
|
|
||||||
# @return [ Array<String> ]
|
# @return [ Array<String> ]
|
||||||
def potential_readme_filenames
|
def potential_readme_filenames
|
||||||
@potential_readme_filenames ||= [*(DB::DynamicFinders::Plugin.db_data.dig(slug, 'Readme', 'path') || super)]
|
@potential_readme_filenames ||= [*(DB::DynamicFinders::Plugin.df_data.dig(slug, 'Readme', 'path') || super)]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ module WPScan
|
|||||||
module DynamicFinders
|
module DynamicFinders
|
||||||
class Base
|
class Base
|
||||||
# @return [ String ]
|
# @return [ String ]
|
||||||
def self.db_file
|
def self.df_file
|
||||||
@db_file ||= DB_DIR.join('dynamic_finders.yml').to_s
|
@df_file ||= DB_DIR.join('dynamic_finders.yml').to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def self.raw_db_data
|
def self.all_df_data
|
||||||
@raw_db_data ||= YAML.safe_load(File.read(db_file), [Regexp])
|
@all_df_data ||= YAML.safe_load(File.read(df_file), [Regexp])
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [ Array<Symbol> ]
|
# @return [ Array<Symbol> ]
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ module WPScan
|
|||||||
module DynamicFinders
|
module DynamicFinders
|
||||||
class Plugin < Base
|
class Plugin < Base
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def self.db_data
|
def self.df_data
|
||||||
@db_data ||= raw_db_data['plugins'] || {}
|
@df_data ||= all_df_data['plugins'] || {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.version_finder_module
|
def self.version_finder_module
|
||||||
@@ -21,7 +21,7 @@ module WPScan
|
|||||||
|
|
||||||
return configs unless allowed_classes.include?(finder_class)
|
return configs unless allowed_classes.include?(finder_class)
|
||||||
|
|
||||||
db_data.each do |slug, finders|
|
df_data.each do |slug, finders|
|
||||||
# Quite sure better can be done with some kind of logic statement in the select
|
# Quite sure better can be done with some kind of logic statement in the select
|
||||||
fs = if aggressive
|
fs = if aggressive
|
||||||
finders.reject { |_f, c| c['path'].nil? }
|
finders.reject { |_f, c| c['path'].nil? }
|
||||||
@@ -48,7 +48,7 @@ module WPScan
|
|||||||
|
|
||||||
@versions_finders_configs = {}
|
@versions_finders_configs = {}
|
||||||
|
|
||||||
db_data.each do |slug, finders|
|
df_data.each do |slug, finders|
|
||||||
finders.each do |finder_name, config|
|
finders.each do |finder_name, config|
|
||||||
next unless config.key?('version')
|
next unless config.key?('version')
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ module WPScan
|
|||||||
module DynamicFinders
|
module DynamicFinders
|
||||||
class Theme < Plugin
|
class Theme < Plugin
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def self.db_data
|
def self.df_data
|
||||||
@db_data ||= raw_db_data['themes'] || {}
|
@df_data ||= all_df_data['themes'] || {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.version_finder_module
|
def self.version_finder_module
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ module WPScan
|
|||||||
module DynamicFinders
|
module DynamicFinders
|
||||||
class Wordpress < Base
|
class Wordpress < Base
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def self.db_data
|
def self.df_data
|
||||||
@db_data ||= raw_db_data['wordpress'] || {}
|
@df_data ||= all_df_data['wordpress'] || {}
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [ Constant ]
|
# @return [ Constant ]
|
||||||
@@ -30,9 +30,9 @@ module WPScan
|
|||||||
return configs unless allowed_classes.include?(finder_class)
|
return configs unless allowed_classes.include?(finder_class)
|
||||||
|
|
||||||
finders = if aggressive
|
finders = if aggressive
|
||||||
db_data.reject { |_f, c| c['path'].nil? }
|
df_data.reject { |_f, c| c['path'].nil? }
|
||||||
else
|
else
|
||||||
db_data.select { |_f, c| c['path'].nil? }
|
df_data.select { |_f, c| c['path'].nil? }
|
||||||
end
|
end
|
||||||
|
|
||||||
finders.each do |finder_name, config|
|
finders.each do |finder_name, config|
|
||||||
@@ -48,7 +48,7 @@ module WPScan
|
|||||||
|
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def self.versions_finders_configs
|
def self.versions_finders_configs
|
||||||
@versions_finders_configs ||= db_data.select { |_finder_name, config| config.key?('version') }
|
@versions_finders_configs ||= df_data.select { |_finder_name, config| config.key?('version') }
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.create_versions_finders
|
def self.create_versions_finders
|
||||||
|
|||||||
Reference in New Issue
Block a user