代码审计-Pluck CMS 后台代码执行漏洞
2023-09-14 08:56:56 时间
admin.php
入口:
后台action=editpage
,此时包含进data/inc/editpage.php
可以进行文章编辑:
editpage.php
# save file写入php文件:
对post传递的title
和content
等参数直接调用save_page
函数:
sanitize
函数对单引号进行过滤,防止二次转义绕过:
function save_file($file, $content, $chmod = 0777) {
$data = fopen($file, 'w');
//If it's an array, we have to create the structure.
if (is_array($content) && !empty($content)) {
$final_content = '<?php'."\n";
foreach ($content as $var => $value) {
$final_content .= '$'.$var.' = \''.$value.'\';'."\n";
}
$final_content .= '?>';
fputs($data, $final_content);
}
else
fputs($data, $content);
fclose($data);
if ($chmod != FALSE)
chmod($file, $chmod);
}
相关文章
- 【转载】升级OpenSSL修复高危漏洞Heartbleed
- Vulhub漏洞靶场搭建和使用
- 16.Tomcat弱口令 && 后台getshell漏洞
- 25.【转载】挖洞技巧:支付漏洞之总结
- 1.4 DVWA亲测文件上传漏洞
- 安全知识图谱——资产(Assets)、漏洞(Vulnerability)和攻击(Attack)。图3表示网络安全本体,其中包含五个实体类型:漏洞、资产、软件、操作系统、攻击。
- WEB漏洞攻防 - SQL注入 - 堆叠注入
- WEB漏洞攻防 - 文件上传漏洞 - CTF - [CTF2020 新生赛] Upload 1
- 逻辑漏洞渗透与攻防(五)之权限类逻辑漏洞
- CVE漏洞复现-CVE-2022-22965-Spring-RCE漏洞