xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

js disabled debugger All In One

js disabled debugger All In One

js 禁用 debugger 功能
js 禁用 console.log 功能

/*

(function anonymous() {
   debugger;
})();

(() => {
   debugger;
})();

*/

// 无限循环,锁死 debugger

(function anonymous() {
   debugger;
   anonymous();
})(); 

破解方案

  1. 浏览器禁用页面 js

chrome://settings/content/siteDetails?site=https%3A%2F%2Fwjx.com

  1. Command + F8

disactive breakpoints 禁用所有断点调试

  1. 打开 Chrome devtools, 选择单独窗口 模式

dock into separate window

demos

((function() {
    var callbacks = [],
        timeLimit = 50,
        open = false;
    setInterval(loop, 1);
    return {
        addListener: function(fn) {
            callbacks.push(fn);
        },
        cancleListenr: function(fn) {
            callbacks = callbacks.filter(function(v) {
                return v !== fn;
            });
        }
    }
    function loop() {
        var startTime = new Date();
        debugger;
        if (new Date() - startTime > timeLimit) {
            if (!open) {
                callbacks.forEach(function(fn) {
                    fn.call(null);
                });
            }
            open = true;
            window.stop();
            alert('不要扒我了');
            window.location.reload();
        } else {
            open = false;
        }
    }
})()).addListener(function() {
    window.location.reload();
});

https://xiaochen1024.com/series/6196129fc1553b002e57bef5

破解 js 禁用 debugger

  1. 首先在一个空白页面,打开 Chrome devtools, 选择单独窗口 模式

dock into a separate window

  1. 禁用 controlslist="nodownload" 属性
<div class="videoWapper">
  <video controls="" controlslist="nodownload" class="video" src="https://mpvideo.qpic.cn/0bc3qiaa4aaaauaeiemdarqvbawdb2baadqa.f10002.mp4?dis_k=b2f551f0075d0104ae196da0978f9d8e&amp;dis_t=1655105757"></video>
</div>
<div class="videoWapper">
  <video controls="" class="video" src="https://mpvideo.qpic.cn/0bc3qiaa4aaaauaeiemdarqvbawdb2baadqa.f10002.mp4?dis_k=b2f551f0075d0104ae196da0978f9d8e&amp;dis_t=1655105757"></video>
</div>
  1. 爬取视频 URL
    https://mpvideo.qpic.cn/0bc3qiaa4aaaauaeiemdarqvbawdb2baadqa.f10002.mp4

禁用前 ❌

破解后 ✅

结论:纯前端技术根本防不住被爬取的,需要在服务端进行更加精细的访问控制 CORS 白名单,stream data, 限制 ip 连接数和频率...

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

https://cdn.xgqfrms.xyz/plugins/locked-debugger.js



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-07-14 17:59  xgqfrms  阅读(131)  评论(8编辑  收藏  举报