Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/core/api/module.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 API
8
module Command
9
end
10
11
module Module
12
# @note Defined API Paths
13
API_PATHS = {
14
'pre_soft_load' => :pre_soft_load,
15
'post_soft_load' => :post_soft_load,
16
'pre_hard_load' => :pre_hard_load,
17
'post_hard_load' => :post_hard_load,
18
'get_options' => :get_options,
19
'get_payload_options' => :get_payload_options,
20
'override_execute' => :override_execute
21
}.freeze
22
23
# Fired before a module soft load
24
# @param [String] mod module key of module about to be soft loaded
25
def pre_soft_load(mod); end
26
27
# Fired after module soft load
28
# @param [String] mod module key of module just after soft load
29
def post_soft_load(mod); end
30
31
# Fired before a module hard load
32
# @param [String] mod module key of module about to be hard loaded
33
def pre_hard_load(mod); end
34
35
# Fired after module hard load
36
# @param [String] mod module key of module just after hard load
37
def post_hard_load(mod); end
38
39
# Fired before standard module options are returned
40
# @return [Hash] a hash of options
41
# @note the option hash is merged with all other API hook's returned hash. Hooking this API method prevents the default options being returned.
42
def get_options; end
43
44
# Fired just before a module is executed
45
# @param [String] mod module key
46
# @param [String] hbsession hooked browser session id
47
# @param [Hash] opts a Hash of options
48
# @note Hooking this API method stops the default flow of the Module.execute() method.
49
def override_execute(mod, hbsession, opts); end
50
51
# Fired when retreiving dynamic payload
52
# @return [Hash] a hash of options
53
# @note the option hash is merged with all other API hook's returned hash. Hooking this API method prevents the default options being returned.
54
def get_payload_options; end
55
end
56
end
57
end
58
59