Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeEF::Extension: Add debug output for extension handling #1873

Merged
merged 1 commit into from
Feb 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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