好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

kuwebs cms SQL注入配合xss到getshell - 网站安全 - 自学

 无聊,测试一个站点,发现是kuwebs源码,谷歌下,发现有人发布了 漏洞 ,但是貌似补了,然后在官网 下载 了一份,在下载的时候居然提示有木马,我了个插,看来有人把kuwebs官网日了,留后门了。。。

      简单看了下,发现了一个注入点,看代码:

 

 

<?php

require_once 'inc/common.inc.php';

 

$strSql = "select * from {$configTableHead}job where id='{$jobid}' and lang='{$kuWebsiteCurrLanguage}';";

 

// $jobid 变量没有经过任何过滤,直接进行 数据库 查询了,但是这里有引号,如果开启了magic就不能注入了,可以考虑下 mysql 的GBK宽字节注入,哟西

 

$kuArrJobInfo = $dbInstance->getOne($strSql);

//$kuResumePost = $row['jobpost'];

 

$kuPositionId = $kuArrJobInfo['type3'] ? $kuArrJobInfo['type3'] : ($kuArrJobInfo['type2'] ? $kuArrJobInfo['type2'] : $kuArrJobInfo['type1']);

.......................

 

$arrMenuInfo = getMenuIdInfo($menuid);   //这里就是注入点了。。。

$topMenuId = '';

if(count($kuMenuList[$kuProductShow['type3']]))$topMenuId = $arrMenuInfo['type3'];

else if(count($kuMenuList[$kuProductShow['type2']]))$topMenuId = $arrMenuInfo['type2'];

else if(count($kuMenuList[$kuProductShow['type1']]))$topMenuId = $arrMenuInfo['type1'];

 

......................函数的说明

 

function getMenuIdInfo($id)

{

    if('' == $id || 0 > $id)return;

    global $configTableHead, $kuWebsiteCurrLanguage, $dbInstance;

    $strSql = "select id, fatherid from {$configTableHead}menu where id={$id};";

    $row1 = $dbInstance->getOne($strSql);

    if(!is_array($row1))return;

    if(0 == intval($row1['fatherid']))

    {

        $arrInfo['level'] = 1;

        $arrInfo['type1'] = $id;

        $arrInfo['type2'] = '';

        $arrInfo['type3'] = '';

        return $arrInfo;

    }

 

 

exp:

 

图:

 

      话说到这里应该结束了,但是kuwebs比较恶心,你不改默认的管理后台路径,它会使劲的弹框提示你修改路径,所以,往往有密码了,没洞插,射不了。现在流行XSS盲打,那我也就流行下,找一下xss,发现网站留言那里存在存储型的xss,然后看了下代码,确实没有经过过滤

 

      最后是拿shell了,拿shell很简单,可以直接修改上传后缀配置,也可以在  网站基本设置->基本信息->{${phpinfo()}}  直接拿shell

 

 

查看更多关于kuwebs cms SQL注入配合xss到getshell - 网站安全 - 自学的详细内容...

  阅读:57次