kakatoji

baypass chapca curl

May 26th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. $ch = curl_init();
  2. // Not sure that I need it, just make sure that the session doesn't change...
  3. curl_setopt($ch, CURLOPT_COOKIESESSION, false);
  4. curl_setopt($ch, CURLOPT_URL, $loginUrl);
  5. // It seems that PHPSESSID cookie parameter might be the parameter that keep the image the same, but it didn't work. I even read it dynamically from the cookie file but it still didn't work
  6. //curl_setopt($ch, CURLOPT_COOKIE, "PHPSESSID=2bp3nhkp3bgftfrr1rjekg03o2");
  7. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieName);
  8. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieName);
  9. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($ch, CURLOPT_REFERER, $loginUrl);
  12. $result = curl_exec($ch);
  13.  
  14. // Resolve the captcha and append it to the post parameters
  15. $captchaText = $this->resolveCaptcha($result);
  16. $postData .= '&LoginForm%5BverifyCode%5D='.$captchaText;
  17.  
  18. // Resubmit the form with the updated form data
  19. curl_setopt($ch, CURLOPT_REFERER, $loginUrl);
  20. curl_setopt($ch, CURLOPT_URL, $loginUrl);
  21. curl_setopt ($ch, CURLOPT_POST, 1); //FIXED
  22. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData);
  23. $result = curl_exec($ch);
Add Comment
Please, Sign In to add comment