总结一下无限debugger的过法

总结一下无限debugger的过法

  1. debugger所在行加条件断点(Add conditional breakpoint)false,但是一些网站会卡死
  2. debugger所在行右键选择never pause here
  3. 使用fd等工具替换源网页中的debugger关键字
  4. 使用chrome的overrides替换源js文件,修改debugger相关代码
  5. constructor关键字启动的debugger,注入代码,最好使用工具注入,浏览器控制台执行的话网页刷新会失效
(()=>{
Function.prototype.__constructor = Function.prototype.constructor;
Function.prototype.constructor = function (){
if (arguments && typeof arguments[0] === 'string'){
  	  if ("debugger" === arguments[0]){
  	  return
  	  }
  	  return Function.prototype.constructor.apply(this, arguments);
  	  }
    }
})()
  1. Function关键字启动的debugger,注入代码
(()=>{
Function.prototype.__constructor = Function;
Function = function (){
if (arguments && typeof arguments[0] === 'string'){
    if ("debugger" === arguments[0]){
  	  return
    }
  	  return Function.apply(this, arguments);
    }
    }
})()
Function.prototype.constructor_bc = Function.prototype.constructor
Function.prototype.constructor = function() {
if (arguments[0] === "debugger") {}
else {
    Function.prototype.constructor_bc.apply(this, arguments)
}
}
  1. eval关键字启动的debugger,替换eval函数
eval_bc = eval
eval = function(a) {
if (a === '(function() {var a = new Date(); debugger; return new Date() - a > 100;}())') {}
else {
    return eval_bc(a)
}
}
  1. 定时器debugger,替换`setInterval`或者清除定时器,也可以使用7方法
setinval_b= setInterval
setInterval = function(a, b) {
if (a.toString().indexOf('debugger') == -1) {
        console.log(a);
  	  return setinval_b(a, b)
    }
}
for (var i = 1; i < 99999; i++)window.clearInterval(i);

猜你喜欢

转载自blog.csdn.net/qq_44253015/article/details/124057698