Perl ошибка в алгоритме

Discussion in 'PHP' started by zeroDay27, 17 May 2014.

  1. zeroDay27

    zeroDay27 New Member

    Joined:
    13 Jan 2014
    Messages:
    11
    Likes Received:
    0
    Reputations:
    0
    Здравствуйте , есть код :
    Code:
    ....
    while(@p)
    { 
     my $pass = '';
     $pass = shift @p;
    
     my $response = $ua->post($url,['email' => $login,'pass' => $pass]);
            my $location = $response->header('Location');
     my $length = length($location);
     my $subloc = "captcha";
    
     if($location=~/$subloc=(\d+)/i)
     {
     my $ca = $1;
     my $rkey = 'F3GER3fsRsgs2';
     my $path = "E:\\"; 
     print "Captcha...  \n"; 
    
    
     my $file = get "http://site.ru/captcha.php?ca=$ca";
     open( CA, '>', $path . 'captcha.jpg' ) or die $!;
     binmode CA;
     print CA $file;
     close( CA );
    
     my $rc = $ua->request(POST 'http://ripcaptcha.com/in.php',
     Content_Type => 'form-data',
     Content => [ method => 'post',
     key => $rkey,
     file => ["captcha.jpg"],
     ]
     );
    
     $rc->decoded_content=~/OK\|(.*)/;
     my $id = $1;
     $rc = $ua->get("http://ripcaptcha.com/res.php?key=$rkey&action=get&id=$id");
     while($rc->decoded_content=~/CAPCHA_NOT_READY/)
     {
     sleep(3);
     $rc = $ua->get("http://ripcaptcha.com/res.php?key=$rkey&action=get&id=$id");
     }
     $rc->decoded_content=~/OK\|(.*)/;
     my $c=$1;
     print "Ca: ".$sid."\n";
     print "Captcha: ".$c."\n";
    
     sleep 5; 
    
     unlink ("captcha.jpg");
     }else{}
     if($length > 90)
     {
     print "[+] $pass\n";
     print $location."\n";
     open(my $save, '>', 'good.txt');
     print $save "$pass";
     close $save;
     last;
    
     }else{
     print "[-] $pass\n";
     print $location."\n";
     }
    sleep 4;
    }
    ....
    
    Как можно заново отправить запрос с тем же значение $pass , вот тут -
    Code:
    ....
     sleep 5; 
    
     unlink ("captcha.jpg");
                   
                [COLOR=Red]  #Отправляем логин и тот же пароль , и если он подходит по критериям то условие заканчивается  , но если есть [COLOR=Blue]my $subloc = "captcha";[/COLOR] то заново обходим капчу...[/COLOR]
    
     }else{}
    ....
    
    Что бы дальше проверяло именно новый http ответ , а именно my $location = $response->header('Location'); -

    Code:
    ...
    if($length > 90)
     {
     print "[+] $pass\n";
     print $location."\n";
     open(my $save, '>', 'good.txt');
     print $save "$pass";
     close $save;
     last;
    
     }else{
     print "[-] $pass\n";
     print $location."\n";
     }
    ....
     
    #1 zeroDay27, 17 May 2014
    Last edited: 17 May 2014
Loading...
Similar Threads - Perl ошибка алгоритме
  1. TikTik
    Replies:
    3
    Views:
    2,849
  2. pharm_all
    Replies:
    3
    Views:
    2,061
  3. TikTik
    Replies:
    10
    Views:
    2,574
  4. sNt
    Replies:
    6
    Views:
    1,902