Path: blob/master/modules/social_engineering/simple_hijacker/module.rb
1873 views
#1# Copyright (c) 2006-2026 Wade Alcorn - [email protected]2# Browser Exploitation Framework (BeEF) - https://beefproject.com3# See the file 'doc/COPYING' for copying permission4#5class Simple_hijacker < BeEF::Core::Command6def self.options7config = BeEF::Core::Configuration.instance8@templates = config.get('beef.module.simple_hijacker.templates')910# Defines which domains to target11data = []12data.push({ 'name' => 'targets', 'description' => 'list domains you want to hijack - separed by ,', 'ui_label' => 'Targetted domains', 'value' => 'beef' })1314# We'll then list all templates available15tmptpl = []16@templates.each do |template|17tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{template}.js"18raise "Invalid template path for command template #{template}" unless File.exist?(tplpath)1920tmptpl << [template]21end2223data.push({ 'name' => 'choosetmpl', 'type' => 'combobox', 'ui_label' => 'Template to use', 'store_type' => 'arraystore', 'store_fields' => ['tmpl'], 'store_data' => tmptpl,24'valueField' => 'tmpl', 'displayField' => 'tmpl', 'mode' => 'local', 'emptyText' => 'Choose a template' })2526data27end2829#30# This method is being called when a zombie sends some31# data back to the framework.32#33def post_execute34save({ 'answer' => @datastore['answer'] })35end36end373839