绕过网站调试保护限制

禁用右键,F12

浏览器窗口 -> 更多 -> 更多工具 -> 开发人员工具

自动进入Debug模式,且debug内容为空

1
2
(function() {}
["constructor"]("debugger")())

alt text

像素检测

网站
检测终端窗口和网页窗口的像素差异

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
var debugflag = false;
document.onkeydown = function() {
if ((e.ctrlKey) && (e.keyCode == 83)) {
alert("检测到非法调试,CTRL + S被管理员禁用");
return false;
}
}
document.onkeydown = function() {
var e = window.event || arguments[0];
if (e.keyCode == 123) {
alert("检测到非法调试,F12被管理员禁用");
return false;
}
}
document.oncontextmenu = function() {
alert('检测到非法调试,右键被管理员禁用');
return false;
}
!function () {
const handler = setInterval(() => {
if (window.outerWidth - window.innerWidth > 300 ||
window.outerHeight - window.innerHeight > 300) {
// document.write((window.outerWidth - window.innerWidth) + ',' + (window.outerHeight - window.innerHeight));
document.write('检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>');
document.write("Welcome for People, Not Welcome for Machine!<br/>");
debugflag = true;
}
const before = new Date();
(function() {}
["constructor"]("debugger")())
const after = new Date();
const cost = after.getTime() - before.getTime();
if (cost > 50) {
debugflag = true;
document.write('检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>');
document.write("Welcome for People, Not Welcome for Machine!<br/>");
}

}, 2000)
}();

将调试窗口弹出即可
alt text

debug构造函数中有内容,内存爆破

本地注入,覆盖原来的js文件

1. 控制台注入

网站
源代码 -> 片段 -> 运行
debugger_hook.js

1
2
3
4
5
6
7
Function.prototype.constructor_ = Function.prototype.constructor;
Function.prototype.constructor = function(a) {
if (a == "debugger") {
return function (){};
}
return Function.prototype.constructor_(a);
}