Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/extensions/admin_ui/handlers/ui.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
#
7
# Generic Http Handler that extensions can use to register http
8
# controllers into the framework.
9
#
10
module BeEF
11
module Extension
12
module AdminUI
13
module Handlers
14
class UI
15
#
16
# Constructor
17
#
18
def initialize(klass)
19
@klass = BeEF::Extension::AdminUI::Controllers.const_get(klass.to_s.capitalize)
20
end
21
22
def call(env)
23
@request = Rack::Request.new(env)
24
@response = Rack::Response.new(env)
25
26
controller = @klass.new
27
controller.run(@request, @response)
28
29
@response = Rack::Response.new(
30
body = [controller.body],
31
status = controller.status,
32
header = controller.headers
33
)
34
end
35
36
@request
37
@response
38
end
39
end
40
end
41
end
42
end
43
44