S0cke3t
文章43
标签29
分类12
WordPress Plugin IEAC RCE analysis

WordPress Plugin IEAC RCE analysis

漏洞简介

Description: It is possible to upload and execute a PHP file using the plugin option to upload a zip archive
Date: june 2019
Exploit Author: xulchibalraa
Vendor Homepage: https://wordpress.org/plugins/insert-or-embed-articulate-content-into-wordpress/
Software Link: https://downloads.wordpress.org/plugin/insert-or-embed-articulate-content-into-wordpress.4.2995.zip
Version: 4.2995

漏洞分析

关于wordpress是如何调用插件的请参考,此处不再赘述

https://www.wenjiangs.com/article/wordpress-plug-in-unit.html

通过作者给出的利用流程,我们最低需要一个投稿者权限的账号。发布一篇文章(实际测试并不需要发布,只要上传文件后就会自动解压),并利用插件的在线学习功能插入我们构造的zip文件。

图片.png

截取并重放文件上传的数据包,在其extractZip()->unzip_file处打入断点。重放后正常运行到程序断点

图片.png

跟进unzip_file

图片.png

进入函数后,程序会引用wordpress所提供的filesystem API 文件操作文件,随后判断文件路径,不存在则进行创建,完成后程序会调用wordpress file API 所提供的unzip_file方法(对pclzip的封装)对压缩包进行解压

图片.png

解压后文件会存放在/wp-content/uploads/articulate_uploads/压缩包名称/中

图片.png

如果解压失败,程序会调用系统的解压命令

图片.png

利用过程

将一个html和php文件压缩为一个zip文件

图片.png

以投稿者身份登录,并发布一篇文章,添加一个e-learning的区块

图片.png

上传准备好的压缩包,完成后访问

http://domain/wp-content/uploads/articulate_uploads/poc/index.php即可

图片.png

参考链接

wordpress-plug-in-unit

https://www.exploit-db.com/exploits/46981

http://www.phpconcept.net/pclzip/

本文作者:S0cke3t
本文链接:https://www.saferoad.cc/Analysis/WordPress-Plugin-IEAC-RCE-analysis.html
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可
×