74cms 后台tpl_dir参数任意代码执行漏洞

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

前言 没有getshell的审计都是耍流氓。 今天突然灵光闪现,重新看了下74cms,终于拿下了。 正文 在Application/Common/Controller/BackendController.class.php 有这么一段可怕的代码 ``` public function update_config($new_config, $config_file = '') { !is_file($config_file) && $config_file = HOME_CONFIG_PATH . 'config.php'; if (is_writable($config_file)) { $config = require $config_file; $config = array_merge($config, $new_config); file_put_contents($config_file, "<?php \nreturn " . stripslashes(var_export($config, true)) . ";", LOCK_EX); @unlink(RUNTIME_FILE); return true; } else { return false; } } ``` 配置文件用return返回var_export,应该是(如果有能绕过,求打脸)挺安全的,所以之前看走眼了。 这里有stripslashes! 全局搜一下 找到 /Application/Admin/Controller/TplController.class.php ``` public function set(){ $tpl_dir = I('request.tpl_dir','','trim'); $templates_info=$this->_get_templates_info($this->tpl_dir.$tpl_dir."/info.txt"); D('Config')->where(array('name'=>'template_dir'))->setField('value',$tpl_dir); if(C('qscms_template_dir') != $tpl_dir) D('AdCategory')->ads_init($tpl_dir);...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息