From 4e2bfc42477c48c19e070181f6b8d68951ce6e27 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 8 Feb 2020 09:02:45 +0000 Subject: [PATCH] BeEF::Extension: Add debug output for extension handling --- core/extensions.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/extensions.rb b/core/extensions.rb index 087a2c28b1..844a5152d5 100644 --- a/core/extensions.rb +++ b/core/extensions.rb @@ -10,12 +10,18 @@ module Extensions # @return [Array] an array of extension configuration hashes that are enabled def self.get_enabled BeEF::Core::Configuration.instance.get('beef.extension').select { |k,v| v['enable'] == true } + rescue => e + print_error "Failed to get enabled extensions: #{e.message}" + print_error e.backtrace end # Returns configuration of all loaded extensions # @return [Array] an array of extension configuration hashes that are loaded def self.get_loaded BeEF::Core::Configuration.instance.get('beef.extension').select {|k,v| v['loaded'] == true } + rescue => e + print_error "Failed to get loaded extensions: #{e.message}" + print_error e.backtrace end # Load all enabled extensions @@ -27,6 +33,9 @@ def self.load } # API post extension load BeEF::API::Registrar.instance.fire BeEF::API::Extensions, 'post_load' + rescue => e + print_error "Failed to load extensions: #{e.message}" + print_error e.backtrace end end end