Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/social_engineering/simple_hijacker/module.rb
1873 views
1
#
2
# Copyright (c) 2006-2026 Wade Alcorn - [email protected]
3
# Browser Exploitation Framework (BeEF) - https://beefproject.com
4
# See the file 'doc/COPYING' for copying permission
5
#
6
class Simple_hijacker < BeEF::Core::Command
7
def self.options
8
config = BeEF::Core::Configuration.instance
9
@templates = config.get('beef.module.simple_hijacker.templates')
10
11
# Defines which domains to target
12
data = []
13
data.push({ 'name' => 'targets', 'description' => 'list domains you want to hijack - separed by ,', 'ui_label' => 'Targetted domains', 'value' => 'beef' })
14
15
# We'll then list all templates available
16
tmptpl = []
17
@templates.each do |template|
18
tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{template}.js"
19
raise "Invalid template path for command template #{template}" unless File.exist?(tplpath)
20
21
tmptpl << [template]
22
end
23
24
data.push({ 'name' => 'choosetmpl', 'type' => 'combobox', 'ui_label' => 'Template to use', 'store_type' => 'arraystore', 'store_fields' => ['tmpl'], 'store_data' => tmptpl,
25
'valueField' => 'tmpl', 'displayField' => 'tmpl', 'mode' => 'local', 'emptyText' => 'Choose a template' })
26
27
data
28
end
29
30
#
31
# This method is being called when a zombie sends some
32
# data back to the framework.
33
#
34
def post_execute
35
save({ 'answer' => @datastore['answer'] })
36
end
37
end
38
39