(1) 明文debugger Function
在js代码执行时. 每一个function的对象都是通过Function()来创建的. 也就是说. 函数是Function()的对象.
function fn(){
}
console.log(fn.__proto__.constructor); // ƒ Function() { [native code] }
// 因为函数也是对象 因此上面的写法等同于
fn.constructor // ƒ Function() { [native code] }
函数就是Function的对象. 那么. 我们可以通过Function来构建一个函数.
new Function('debugger')();
跑起来的效果一样的.
进行hook处理
var fun = Function
Function = function (arg) {
let a = arg.replaceAll('debugger', '')
return fun(a)
}
- 概述:
无限调试器(Infinite Debugger)是一个开发工具,用于帮助程序员在软件开发过程中进行调试,对于我们爬虫来说,是一种网站的反扒机制
(2) 明文debugger setInterval
-
代码:
<script> setInterval(function (){ debugger; }, 1000); // 每隔一秒执行一次debugger </script>
-
解决方式:
-
Never pause here (推荐使用)
找到出现debugger的位置 点击debugger 右键选择Never pause here即可
如果出现多个debugger ,重复刚才的操作即可
-
-
hook—setInterval
和业务无关
- 先设置断点 并 点击如图所示位置 调出console功能栏 然后刷新
-
在console中重写setIntervel方法(操作当前之前需要刷新 让断点断到1这个位置)
-
业务代码和 setInt
-