浏览器扩展或插件绕过disable-devtool等库的限制。有哪些?
作者:卡卷网发布时间:2024-12-10 14:45浏览数量:101次评论数量:0次
disable-devtool只是一个js库,大部分情况没人会专门去尝试写个反插件的
因为类似的东西实在太多太多了
更好的处理方案是自己花一点点时间分析
测试地址https://tongcheng360.com/ |
堆栈回溯可以拿到
A = window.setInterval(function() {
if (!(e.isSuspend || l || D())) {
var t, n, i = f(U);
try {
for (i.s(); !(t = i.n()).done; ) {
var o = t.value;
L[o.type] = !1,
o.detect(q++)
}
} catch (e) {
i.e(e)
} finally {
i.f()
}
T(),
"function" == typeof d.ondevtoolclose && (n = j,
!_() && n && d.ondevtoolclose())
}
}, d.interval),
根据代码特征是disable-devtool
github.com/theajack/disable-devtool先不思考太多,我们先一处一处过,首先对setInterval进行hook,对函数进行toString来检测
代码如下
// ==UserScript==
// @name Pass Console
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @match https://tongcheng360.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
const originSetInterval = window.setInterval
window.setInterval = function (func, time) {
if (func.toString().indexOf('ondevtoolclose') !== -1) {
return -1
}
return originSetInterval.call(this, func, time)
}
测试一下,结果发现只有这一个地方检测,绕过成功
免责声明:本文由卡卷网编辑并发布,但不代表本站的观点和立场,只提供分享给大家。
相关推荐

你 发表评论:
欢迎