码迷,mamicode.com
首页 > 其他好文 > 详细

梦之光芒/Monyer 小游戏

时间:2019-05-06 19:01:23      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:返回   hello   contex   href   游戏   str   js代码   网站链接   floor   

网站链接: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

 

梦之光芒/Monyer 小游戏

标签:返回   hello   contex   href   游戏   str   js代码   网站链接   floor   

原文地址:https://www.cnblogs.com/LK141595205xy/p/10821201.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!