Advertisement
kakatoji

melewati recaptcha sederhana

Aug 16th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['g-recaptcha-response'])){
  3.  
  4. $cookie="cookie.txt";
  5. if(!file_exists($cookie)){
  6. $fh = fopen($cookie, "w");
  7. fwrite($fh, "");
  8. fclose($fh);
  9. }
  10. $captcha=$_POST['g-recaptcha-response'];
  11.  
  12. $postdata = "username=xxx&password=xxx&g-recaptcha-response=$captcha";
  13. $ch = curl_init();
  14. curl_setopt ($ch, CURLOPT_URL, "REMOTE URL LOGIN");
  15. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  16. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  17. curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
  18. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  19. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  20. curl_setopt ($ch, CURLOPT_COOKIE,1);
  21. curl_setopt ($ch, CURLOPT_COOKIEJAR,$cookie);
  22. curl_setopt ($ch, CURLOPT_COOKIEFILE,$cookie);
  23.  
  24. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  25. curl_setopt ($ch, CURLOPT_POST, 1);
  26.  
  27. $result = curl_exec($ch);
  28.  
  29. echo $result;
  30. }else{
  31. ?>
  32. <script src="//www.google.com/recaptcha/api.js" type="text/javascript"></script>
  33. <form method="post" action="" name="signup-form">
  34. <center><div class="g-recaptcha" data-theme="light" data-sitekey="SITEKEYREMOTELOGIN"></div></center>
  35. <button type="submit" name="submit">SUBMIT</button>
  36. </form>
  37. <?php
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement