Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/extensions/customhook/api.rb
1154 views
1
#
2
# Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
# Browser Exploitation Framework (BeEF) - https://beefproject.com
4
# See the file 'doc/COPYING' for copying permission
5
#
6
module BeEF
7
module Extension
8
module Customhook
9
module RegisterHttpHandlers
10
BeEF::API::Registrar.instance.register(BeEF::Extension::Customhook::RegisterHttpHandlers, BeEF::API::Server, 'mount_handler')
11
BeEF::API::Registrar.instance.register(BeEF::Extension::Customhook::RegisterHttpHandlers, BeEF::API::Server, 'pre_http_start')
12
13
def self.mount_handler(beef_server)
14
configuration = BeEF::Core::Configuration.instance
15
configuration.get('beef.extension.customhook.hooks').each do |h|
16
beef_server.mount(configuration.get("beef.extension.customhook.hooks.#{h.first}.path"), BeEF::Extension::Customhook::Handler.new)
17
end
18
end
19
20
def self.pre_http_start(_beef_server)
21
configuration = BeEF::Core::Configuration.instance
22
configuration.get('beef.extension.customhook.hooks').each do |h|
23
print_success 'Successfully mounted a custom hook point'
24
print_more "Mount Point: #{configuration.get("beef.extension.customhook.hooks.#{h.first}.path")}\nLoading iFrame: #{configuration.get("beef.extension.customhook.hooks.#{h.first}.target")}\n"
25
end
26
end
27
end
28
end
29
end
30
end
31
32