theajack / disable-devtool

Disable web developer tools from the f12 button, right-click and browser menu
https://theajack.github.io/disable-devtool/
MIT License
1.92k stars 184 forks source link

请问这个该怎么破解?我在调试别人的网站时发现了这个,如何才能绕过这个? #101

Closed xcfstudio closed 3 months ago

gitlilimin commented 4 months ago

可以用控制台的【源代码/来源】面板中的【替换】功能,大致步骤如下

  1. 先打开空白页面,打开控制台,切换到【源代码】面板,鼠标瞄准右上角的暂停JS按钮,再打开目标网页
  2. 在触发disable-devtool之前暂停JS,此时控制台左侧【网页】标签中会拿到目标站点的所有资源文件,这里主要针对js资源进行搜索,通过本项目的一些配置项或名称关键字进行搜索,例如disable-devtool、ignore、tkName或者正则等(因为该库的配置对象的key不会受到代码混淆的影响,聪明的小朋友可以用合适的正则来完成)
  3. 如果成功找到启用 diable-devtool 的这一行代码,例如 DisableDevtool({url:'xxx',md5:'xxx',ignore:()=>'xxx'}); 接下来对它进行本地替换即可
  4. 右键点击代码,选择【替换内容】,如果是sourceMap会提示去替换原始文件,那么在原始文件中还需要根据关键字搜索一下。然后利用本地替换(勾选左侧【替换】面板的启用本地替换,选择一个本地空文件夹)给它设置一个参数 ignore:()=>true

好了,大功告成

Mrgaton commented 3 months ago

wtf is this issue i dont know if its the translator or what but the title doesnt make any sense

Do you want me to show you how you feel? Do you want me to show you how you feel when you wake up?

theajack commented 3 months ago

I'm sure it's a translation issue @Mrgaton

cubxx commented 1 month ago
function checkCtx(filename) {
  return new Error().stack
    ?.split('\n')
    .slice(2)
    .some((e) => e.includes(filename));
}
function override(obj, key, convert) {
  const d = Object.getOwnPropertyDescriptor(obj, key);
  Object.defineProperty(obj, key, Object.assign({}, d, convert(d)));
}
override(window, 'setInterval', ({ value }) => ({
  value(fn, t) {
    checkCtx('your-script.js') && ('' + fn).includes('ondevtoolclose')
      ? console.log('disabled setInterval')
      : value.call(this, fn, t);
  },
}));
farhansolodev commented 1 month ago

@Cubxx what is "your-script.js" ?

cubxx commented 1 month ago

@Cubxx what is "your-script.js" ?

checkCtx means to check whether window.setInterval is be called in the specific script file, it's just a supplementary measure, not core.

Actually, everything in JS can be override easily, so it just provide a idea, maybe not the best implement.