Advertisement
Combreal

NCprog01.php

Jul 17th, 2020
1,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. //used Export Cookies extension to get NC cookie
  3. $ch = curl_init ();
  4. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  5. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  6. $timeout = 0;
  7. $myHITurl = "https://www.newbiecontest.org/epreuves/prog/prog1.php";
  8. curl_setopt ( $ch, CURLOPT_URL, $myHITurl );
  9. curl_setopt ( $ch, CURLOPT_HEADER, 0 );
  10. curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
  11. curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
  12. curl_setopt($ch, CURLOPT_COOKIEFILE, 'C:/Temp/cookies.txt');
  13. curl_setopt($ch, CURLOPT_VERBOSE, true);
  14. $file_contents = curl_exec ( $ch );
  15. if (curl_errno ( $ch )) {
  16.     echo curl_error ( $ch );
  17.     curl_close ( $ch );
  18.     exit ();
  19. }
  20. curl_close ( $ch );
  21.  
  22. $int = (int) filter_var($file_contents, FILTER_SANITIZE_NUMBER_INT);
  23. $subm = "https://www.newbiecontest.org/epreuves/prog/verifpr1.php?solution=" . $int;
  24. echo $subm;
  25. header("Location: $subm");
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement