有个网站我点击F12后,浏览器就变得异常卡顿

访问某个网站,点击F12后,浏览器就卡死了

今天访问一个网站,点击F12后,浏览器就卡顿了,试了几次,发现CPU会变成百分百。网址栏的域名后面跟着一长串的数字,而且点击Elements看不到任何html、css。我想问问这是怎么实现的?下图是网址后面的数字。(域名为 www.okjx.cc)

有个网站我点击F12想查看源码就卡死了

我爱大可乐
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
mouyong
最佳答案

查看源代码

Laravel

获取源代码中的重要信息

Laravel

解密

通过浏览器的 history.pushState 修改了地址栏。触发了浏览器 414 Request-URI Too Large
F12 打开控制器时,会执行 js 代码,console.log 对应的东西。

tmp = function (d, f, a, c, b, e) {
    b = function (a) {
        return a.toString(f)
    };
    if (!"".replace(/^/, String)) {
        for (; a--;) e[b(a)] = c[a] || b(a);
        c = [function (a) {
            return e[a]
        }];
        b = function () {
            return "\\w+"
        };
        a = 1
    }
    for (; a--;) c[a] && (d = d.replace(new RegExp("\\b" + b(a) + "\\b", "g"), c[a]));
    return d
}("1 2=c.3('8');4.b(2,'5',{6:7(){1 a=\"\";9(1 i=0;i<d;i++){a=a+i.e();f.g(0,0,a)}}});h.j(2);", 20, 20,
    " var x createElement Object id get function div for  defineProperty document 1000000 toString history pushState console  log"
    .split(" "), 0, {});

console.log(tmp)
var x = document.createElement('div');
Object.defineProperty(x, 'id', {
    get: function () {
        var a = "";
        for (var i = 0; i < 1000000; i++) {
            a = a + i.toString();
            // history.pushState(0, 0, a)
        }
        console.log(a)
    }
});
console.log(x);

Laravel

5年前 评论
PRO1111 2年前
讨论数量: 14

这个简单,你使用curl www.okjx.cc,然后会返回网页,你可以看到前面一点有一段脚本:

  <script>eval(function(d,f,a,c,b,e){b=function(a){return a.toString(f)};if(!"".replace(/^/,String)){for(;a--;)e[b(a)]=c[a]||b(a);c=[function(a){return e[a]}];b=function(){return"\\w+"};a=1}for(;a--;)c[a]&&(d=d.replace(new RegExp("\\b"+b(a)+"\\b","g"),c[a]));return d}("1 2=c.3('8');4.b(2,'5',{6:7(){1 a=\"\";9(1 i=0;i<d;i++){a=a+i.e();f.g(0,0,a)}}});h.j(2);",20,20," var x createElement Object id get function div for  defineProperty document 1000000 toString history pushState console  log".split(" "),0,{}));</script>
   <script type="text/javascript">var OriginTitile = document.title;
      var titleTime;
      document.addEventListener('visibilitychange',
      function() {
        if (document.hidden) {
          document.title = 'φ(>ω<*) 这有好东西哦~ ' + OriginTitile;
          clearTimeout(titleTime);
        } else {
          document.title = '( • ̀ω•́ )✧恭喜你发现了~ ' + OriginTitile;
          titleTime = setTimeout(function() {
            document.title = OriginTitile;
          },
          2000);
        }
      });</script>
5年前 评论
我爱大可乐 (楼主) 5年前

为啥 我看这个网站不卡呢?

5年前 评论
我爱大可乐 (楼主) 5年前

解码得到这个,但是我没看懂怎么触发的: var x = document.createElement('div'); Object.defineProperty(x, 'id', { get: function () { var a = ""; for (var i = 0; i < 1000000; i++) { a = a + i.toString(); history.pushState(0, 0, a) } } }); console.log(x);

5年前 评论
fffswhk 5年前
smiao (作者) 5年前

你这问题问的我都怀疑你是来打广告的 :smile:

5年前 评论
我爱大可乐 (楼主) 5年前
Atzcl

通过 console.log(dom) 来实现:当打开控制台的时候,就执行用 defineProperty 劫持的 get 方法,这个 get 方法里面利用 history.pushState 来改变浏览器的 url

可以通过代理电脑 or 浏览器的请求,把这个站点的这段代码给过滤掉

5年前 评论
mouyong

查看源代码

Laravel

获取源代码中的重要信息

Laravel

解密

通过浏览器的 history.pushState 修改了地址栏。触发了浏览器 414 Request-URI Too Large
F12 打开控制器时,会执行 js 代码,console.log 对应的东西。

tmp = function (d, f, a, c, b, e) {
    b = function (a) {
        return a.toString(f)
    };
    if (!"".replace(/^/, String)) {
        for (; a--;) e[b(a)] = c[a] || b(a);
        c = [function (a) {
            return e[a]
        }];
        b = function () {
            return "\\w+"
        };
        a = 1
    }
    for (; a--;) c[a] && (d = d.replace(new RegExp("\\b" + b(a) + "\\b", "g"), c[a]));
    return d
}("1 2=c.3('8');4.b(2,'5',{6:7(){1 a=\"\";9(1 i=0;i<d;i++){a=a+i.e();f.g(0,0,a)}}});h.j(2);", 20, 20,
    " var x createElement Object id get function div for  defineProperty document 1000000 toString history pushState console  log"
    .split(" "), 0, {});

console.log(tmp)
var x = document.createElement('div');
Object.defineProperty(x, 'id', {
    get: function () {
        var a = "";
        for (var i = 0; i < 1000000; i++) {
            a = a + i.toString();
            // history.pushState(0, 0, a)
        }
        console.log(a)
    }
});
console.log(x);

Laravel

5年前 评论
PRO1111 2年前

vip解析的视频都不大清楚

5年前 评论
我爱大可乐 (楼主) 5年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!