dedecms /include/helpers/archive.helper.php SQL Injection Vul

本文详细分析了Dedecms会员中心存在的注入漏洞,包括触发条件、影响范围及代码层面的具体分析,并提出了有效的防御措施。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

catalog

1. 漏洞描述
2. 漏洞触发条件
3. 漏洞影响范围
4. 漏洞代码分析
5. 防御方法
6. 攻防思考

 

1. 漏洞描述

Dedecms会员中心注入漏洞

Relevant Link:

http://www.wooyun.org/bugs/wooyun-2010-048892


2. 漏洞触发条件

1. 打开http://127.0.0.1/dedecms5.7/member/soft_add.php
2. 添加软件
3. 打开BURP抓包
    1) 将picnum改成typeid2
    2) 然后参数写5',1,1,1,@`'`),('-1','7',user() , '3','1389688643', '1389688643', '8'),(1,2,'


3. 漏洞影响范围
4. 漏洞代码分析

/include/helpers/archive.helper.php

if ( ! function_exists('GetIndexKey')) 
{ 
    function GetIndexKey($arcrank, $typeid, $sortrank=0, $channelid=1, $senddate=0, $mid=1) 
    { 
        //$typeid2来自外部,结合DEDE的本地变量覆盖漏洞即可修改这个变量值
        global $dsql,$senddate,$typeid2;  
        
        if(empty($typeid2)) $typeid2 = 0; 
        if(empty($senddate)) $senddate = time(); 
        if(empty($sortrank)) $sortrank = $senddate;
        
        //$typeid2、$senddate未进行有效过滤就带入SQL查询
        $iquery = "
        INSERT INTO `#@__arctiny` (`arcrank`,`typeid`,`typeid2`,`channel`,`senddate`, `sortrank`, `mid`) 
        VALUES ('$arcrank','$typeid','$typeid2' , '$channelid','$senddate', '$sortrank', '$mid') ";
        
        echo    $iquery;

        $dsql->ExecuteNoneQuery($iquery); 
        $aid = $dsql->GetLastID(); 
        return $aid; 
    } 
}

/archive.helper.php是一个辅助函数库,是存在漏洞的源头,真正的漏洞攻击向量由调用这个文件的GetIndexKey函数触发
/member/soft_add.php

else if($dopost=='save')
{
    $description = '';
    include(DEDEMEMBER.'/inc/archives_check.php');

    //生成文档ID
    $arcID = GetIndexKey($arcrank,$typeid,$sortrank,$channelid,$senddate,$mid);
..

Relevant Link:

http://www.wooyun.org/bugs/wooyun-2010-048892


5. 防御方法

/include/helpers/archive.helper.php

if ( ! function_exists('GetIndexKey'))
{
    function GetIndexKey($arcrank, $typeid, $sortrank=0, $channelid=1, $senddate=0, $mid=1)
    {
        //$typeid2来自外部,结合DEDE的本地变量覆盖漏洞即可修改这个变量值
        global $dsql,$senddate,$typeid2;
        if(empty($typeid2)) $typeid2 = 0;
        if(empty($senddate)) $senddate = time();
        if(empty($sortrank)) $sortrank = $senddate;
        /* 过滤 */
        $typeid2 = intval($typeid2);
        $senddate = intval($senddate);
        /* */
        $iquery = "
          INSERT INTO `#@__arctiny` (`arcrank`,`typeid`,`typeid2`,`channel`,`senddate`, `sortrank`, `mid`)
          VALUES ('$arcrank','$typeid','$typeid2' , '$channelid','$senddate', '$sortrank', '$mid') ";
        $dsql->ExecuteNoneQuery($iquery);
        $aid = $dsql->GetLastID();
        return $aid;
    }
}


6. 攻防思考

Copyright (c) 2015 LittleHann All rights reserved

 

补充说明 fa@zcn:~/mycode/simulation$ rufa@zcn:~/mycode/simulation$ dpkg -L liblog4cxx-dev # 确认包含log4cxx-config.cmake文件 /. /usr /usr/include /usr/include/log4cxx /usr/include/log4cxx/appender.h /usr/include/log4cxx/appenderskeleton.h /usr/include/log4cxx/asyncappender.h /usr/include/log4cxx/basicconfigurator.h /usr/include/log4cxx/config /usr/include/log4cxx/config/propertysetter.h /usr/include/log4cxx/consoleappender.h /usr/include/log4cxx/dailyrollingfileappender.h /usr/include/log4cxx/db /usr/include/log4cxx/db/odbcappender.h /usr/include/log4cxx/defaultconfigurator.h /usr/include/log4cxx/defaultloggerfactory.h /usr/include/log4cxx/file.h /usr/include/log4cxx/fileappender.h /usr/include/log4cxx/filter /usr/include/log4cxx/filter/andfilter.h /usr/include/log4cxx/filter/denyallfilter.h /usr/include/log4cxx/filter/expressionfilter.h /usr/include/log4cxx/filter/levelmatchfilter.h /usr/include/log4cxx/filter/levelrangefilter.h /usr/include/log4cxx/filter/locationinfofilter.h /usr/include/log4cxx/filter/mapfilter.h /usr/include/log4cxx/filter/propertyfilter.h /usr/include/log4cxx/filter/stringmatchfilter.h /usr/include/log4cxx/helpers /usr/include/log4cxx/helpers/absolutetimedateformat.h /usr/include/log4cxx/helpers/appenderattachableimpl.h /usr/include/log4cxx/helpers/aprinitializer.h /usr/include/log4cxx/helpers/bufferedoutputstream.h /usr/include/log4cxx/helpers/bufferedwriter.h /usr/include/log4cxx/helpers/bytearrayinputstream.h /usr/include/log4cxx/helpers/bytearrayoutputstream.h /usr/include/log4cxx/helpers/bytebuffer.h /usr/include/log4cxx/helpers/cacheddateformat.h /usr/include/log4cxx/helpers/charsetdecoder.h /usr/include/log4cxx/helpers/charsetencoder.h /usr/include/log4cxx/helpers/class.h /usr/include/log4cxx/helpers/classregistration.h /usr/include/log4cxx/helpers/condition.h /usr/include/log4cxx/helpers/cyclicbuffer.h /usr/include/log4cxx/helpers/datagrampacket.h /usr/include/log4cxx/helpers/datagramsocket.h /usr/include/log4cxx/helpers/date.h /usr/include/log4cxx/helpers/dateformat.h /usr/include/log4cxx/helpers/datelayout.h /usr/include/log4cxx/helpers/datetimedateformat.h /usr/include/log4cxx/helpers/exception.h /usr/include/log4cxx/helpers/fileinputstream.h /usr/include/log4cxx/helpers/fileoutputstream.h /usr/include/log4cxx/helpers/filewatchdog.h /usr/include/log4cxx/helpers/inetaddress.h /usr/include/log4cxx/helpers/inputstream.h /usr/include/log4cxx/helpers/inputstreamreader.h /usr/include/log4cxx/helpers/integer.h /usr/include/log4cxx/helpers/iso8601dateformat.h /usr/include/log4cxx/helpers/loader.h /usr/include/log4cxx/helpers/locale.h /usr/include/log4cxx/helpers/loglog.h /usr/include/log4cxx/helpers/messagebuffer.h /usr/include/log4cxx/helpers/mutex.h /usr/include/log4cxx/helpers/object.h /usr/include/log4cxx/helpers/objectimpl.h /usr/include/log4cxx/helpers/objectoutputstream.h /usr/include/log4cxx/helpers/objectptr.h /usr/include/log4cxx/helpers/onlyonceerrorhandler.h /usr/include/log4cxx/helpers/optionconverter.h /usr/include/log4cxx/helpers/outputstream.h /usr/include/log4cxx/helpers/outputstreamwriter.h /usr/include/log4cxx/helpers/pool.h /usr/include/log4cxx/helpers/properties.h /usr/include/log4cxx/helpers/propertyresourcebundle.h /usr/include/log4cxx/helpers/reader.h /usr/include/log4cxx/helpers/relativetimedateformat.h /usr/include/log4cxx/helpers/resourcebundle.h /usr/include/log4cxx/helpers/serversocket.h /usr/include/log4cxx/helpers/simpledateformat.h /usr/include/log4cxx/helpers/socket.h /usr/include/log4cxx/helpers/socketoutputstream.h /usr/include/log4cxx/helpers/strftimedateformat.h /usr/include/log4cxx/helpers/strictmath.h /usr/include/log4cxx/helpers/stringhelper.h /usr/include/log4cxx/helpers/stringtokenizer.h /usr/include/log4cxx/helpers/synchronized.h /usr/include/log4cxx/helpers/syslogwriter.h /usr/include/log4cxx/helpers/system.h /usr/include/log4cxx/helpers/systemerrwriter.h /usr/include/log4cxx/helpers/systemoutwriter.h /usr/include/log4cxx/helpers/tchar.h /usr/include/log4cxx/helpers/thread.h /usr/include/log4cxx/helpers/threadlocal.h /usr/include/log4cxx/helpers/threadspecificdata.h /usr/include/log4cxx/helpers/timezone.h /usr/include/log4cxx/helpers/transcoder.h /usr/include/log4cxx/helpers/transform.h /usr/include/log4cxx/helpers/writer.h /usr/include/log4cxx/helpers/xml.h /usr/include/log4cxx/hierarchy.h /usr/include/log4cxx/htmllayout.h /usr/include/log4cxx/layout.h /usr/include/log4cxx/level.h /usr/include/log4cxx/log4cxx.h /usr/include/log4cxx/logger.h /usr/include/log4cxx/logmanager.h /usr/include/log4cxx/logstring.h /usr/include/log4cxx/mdc.h /usr/include/log4cxx/ndc.h /usr/include/log4cxx/net /usr/include/log4cxx/net/smtpappender.h /usr/include/log4cxx/net/socketappender.h /usr/include/log4cxx/net/socketappenderskeleton.h /usr/include/log4cxx/net/sockethubappender.h /usr/include/log4cxx/net/syslogappender.h /usr/include/log4cxx/net/telnetappender.h /usr/include/log4cxx/net/xmlsocketappender.h /usr/include/log4cxx/nt /usr/include/log4cxx/nt/nteventlogappender.h /usr/include/log4cxx/nt/outputdebugstringappender.h /usr/include/log4cxx/pattern /usr/include/log4cxx/pattern/classnamepatternconverter.h /usr/include/log4cxx/pattern/datepatternconverter.h /usr/include/log4cxx/pattern/filedatepatternconverter.h /usr/include/log4cxx/pattern/filelocationpatternconverter.h /usr/include/log4cxx/pattern/formattinginfo.h /usr/include/log4cxx/pattern/fulllocationpatternconverter.h /usr/include/log4cxx/pattern/integerpatternconverter.h /usr/include/log4cxx/pattern/levelpatternconverter.h /usr/include/log4cxx/pattern/linelocationpatternconverter.h /usr/include/log4cxx/pattern/lineseparatorpatternconverter.h /usr/include/log4cxx/pattern/literalpatternconverter.h /usr/include/log4cxx/pattern/loggerpatternconverter.h /usr/include/log4cxx/pattern/loggingeventpatternconverter.h /usr/include/log4cxx/pattern/messagepatternconverter.h /usr/include/log4cxx/pattern/methodlocationpatternconverter.h /usr/include/log4cxx/pattern/nameabbreviator.h /usr/include/log4cxx/pattern/namepatternconverter.h /usr/include/log4cxx/pattern/ndcpatternconverter.h /usr/include/log4cxx/pattern/patternconverter.h /usr/include/log4cxx/pattern/patternparser.h /usr/include/log4cxx/pattern/propertiespatternconverter.h /usr/include/log4cxx/pattern/relativetimepatternconverter.h /usr/include/log4cxx/pattern/threadpatternconverter.h /usr/include/log4cxx/pattern/throwableinformationpatternconverter.h /usr/include/log4cxx/patternlayout.h /usr/include/log4cxx/portability.h /usr/include/log4cxx/private /usr/include/log4cxx/private/log4cxx_private.h /usr/include/log4cxx/propertyconfigurator.h /usr/include/log4cxx/provisionnode.h /usr/include/log4cxx/rolling /usr/include/log4cxx/rolling/action.h /usr/include/log4cxx/rolling/filerenameaction.h /usr/include/log4cxx/rolling/filterbasedtriggeringpolicy.h /usr/include/log4cxx/rolling/fixedwindowrollingpolicy.h /usr/include/log4cxx/rolling/gzcompressaction.h /usr/include/log4cxx/rolling/manualtriggeringpolicy.h /usr/include/log4cxx/rolling/rollingfileappender.h /usr/include/log4cxx/rolling/rollingfileappenderskeleton.h /usr/include/log4cxx/rolling/rollingpolicy.h /usr/include/log4cxx/rolling/rollingpolicybase.h /usr/include/log4cxx/rolling/rolloverdescription.h /usr/include/log4cxx/rolling/sizebasedtriggeringpolicy.h /usr/include/log4cxx/rolling/timebasedrollingpolicy.h /usr/include/log4cxx/rolling/triggeringpolicy.h /usr/include/log4cxx/rolling/zipcompressaction.h /usr/include/log4cxx/rollingfileappender.h /usr/include/log4cxx/simplelayout.h /usr/include/log4cxx/spi /usr/include/log4cxx/spi/appenderattachable.h /usr/include/log4cxx/spi/configurator.h /usr/include/log4cxx/spi/defaultrepositoryselector.h /usr/include/log4cxx/spi/errorhandler.h /usr/include/log4cxx/spi/filter.h /usr/include/log4cxx/spi/hierarchyeventlistener.h /usr/include/log4cxx/spi/location /usr/include/log4cxx/spi/location/locationinfo.h /usr/include/log4cxx/spi/loggerfactory.h /usr/include/log4cxx/spi/loggerrepository.h /usr/include/log4cxx/spi/loggingevent.h /usr/include/log4cxx/spi/optionhandler.h /usr/include/log4cxx/spi/repositoryselector.h /usr/include/log4cxx/spi/rootlogger.h /usr/include/log4cxx/spi/triggeringeventevaluator.h /usr/include/log4cxx/stream.h /usr/include/log4cxx/ttcclayout.h /usr/include/log4cxx/varia /usr/include/log4cxx/varia/fallbackerrorhandler.h /usr/include/log4cxx/writerappender.h /usr/include/log4cxx/xml /usr/include/log4cxx/xml/domconfigurator.h /usr/include/log4cxx/xml/xmllayout.h /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/liblog4cxx.a /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/x86_64-linux-gnu/pkgconfig/liblog4cxx.pc /usr/share /usr/share/doc /usr/share/doc/liblog4cxx-dev /usr/share/doc/liblog4cxx-dev/copyright /usr/share/doc/liblog4cxx-dev/examples /usr/share/doc/liblog4cxx-dev/examples/Makefile.am /usr/share/doc/liblog4cxx-dev/examples/console.cpp /usr/share/doc/liblog4cxx-dev/examples/delayedloop.cpp /usr/share/doc/liblog4cxx-dev/examples/stream.cpp /usr/share/doc/liblog4cxx-dev/examples/trivial.cpp /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/liblog4cxx-dev /usr/lib/x86_64-linux-gnu/liblog4cxx.so /usr/share/doc/liblog4cxx-dev/NOTICE /usr/share/doc/liblog4cxx-dev/changelog.Debian.gz rufa@zcn:~/mycode/simulation$
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值