目标网址:http://zrzy.gansu.gov.cn/zrzy/c116319/xxgk_list.shtml
首先 如果对Debugger不了解的同学 参考我上一期博客 下面我们直接进入实战
浏览器输入网址回车后 F12
此时就会发现 页面已经被Debugger断住
对代码格式化后 会得到以下页面

这里不难发现 除了第2706行的debugger断点外 页面还用了如变量名混淆一类的js混淆技术
暂时看不出这里的代码有什么端倪

先直接用上一期讲的Edit breakpoint方法跳过这个debugger

将debugger属性改为false

直接下一步

此时会发现 已经陷入了新的虚拟机断点中 并且这里对时间进行了检测
不难想象 如果我们处理不当 会直接陷入无限debugger
这里如果只对debugger进行处理 显然是没有用的 因为我们无法控制两个时间戳相减小于100
所以最直接的想法便是修改调用处的代码

我们对他进行跟栈 可以找到如上调用处
此时我们已经回到了VM7中 我们对调用处进行具体分析




综合以上信息 我们可以得出以下结论
// _$de == Window
// _$dh == "eval"
// _$ek == Array()
// _$bY == 2
// _$ek[2] == "(function() {var a = new Date(); debugger; return new Date() - a > 100;}())"
// 所以 这一行实际代码如下
eval("(function() {var a = new Date(); debugger; return new Date() - a > 100;}())")
此时我们已经分析出 陷入debugger的真正起因
解决起来也就非常容易了 我们直接使用代码替换的方式 将_$ek[2]中debugger替换掉
_$ek[2] = _$ek[2].replace("debugger;"," ");
在控制台执行以上代码
这里需要注意 首先你的数组名与我的不一定一样 需要根据实际情况写数组名
第二养成好习惯 替换时让字符串长度不变 防止对方对字符串长度进行检测

同时我们回到VM78中 将此处的debugger跳过

再次点击小箭头
此时可以发现 我们已经成功绕过了所有debugger反爬
网友评论