梦之光芒/Monyer 小游戏

网站链接:http://monyer.com/game/game1/

首页

打开网站之后找不到第一关的链接,然后F12查看源代码,发现第一关链接:http://monyer.com/game/game1/first.php

                                          

第一关

首先查看源代码,发现一段js代码

    function check(){
        if(document.getElementById('txt').value=="  "){
            window.location.href="hello.php";
        }else{
            alert("密码错误");
        }
    }

 密码是两个空格,对!就是两个空格。

当然也可以不输入密码直接访问第二关

第二关链接:http://monyer.com/game/game1/hello.php

第二关

打开第二关之后又是代码审计

  document.oncontextmenu=function(){return false};

    var a,b,c,d,e,f,g;
    a = 3.14;
    b = a * 2;
    c = a + b;
    d = c / b + a;
    e = c - d * b + a;
    f = e + d /c -b * a;
    g = f * e - d + c * b + a;
    a = g * g;
    a = Math.floor(a);

    function check(){
        if(document.getElementById("txt").value==a){
            window.location.href=a + ".php";
        }else{
            alert("密码错误");
            return false;
        }
    }

 其他的都不重要,只需要把中间那一段中的a计算出来就好了

Math.floor()方法执行的是向下取整计算,它返回的是小于等于函数参数的值,并且与之最接近的整数。

g*g计算出的值为424178.250000,所以a的值为424178,输入密码,进入第三关:http://monyer.com/game/game1/424178.php

猜你喜欢

转载自www.cnblogs.com/LK141595205xy/p/10821201.html