Advertisement
P22DX

anjay.php

Jun 6th, 2020
1,577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <?php
  2.  
  3. // require './vendor/autoload.php';
  4.  
  5. $ch = curl_init();
  6. $tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'cookie.txt';
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  9. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
  10. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  11. //curl_setopt($ch, CURLOPT_VERBOSE, true);
  12. curl_setopt($ch, CURLOPT_COOKIEFILE, $tmp);
  13. curl_setopt($ch, CURLOPT_COOKIEJAR, $tmp);
  14.  
  15. function post(string $url, array $fields)
  16. {
  17.     global $ch;
  18.     curl_setopt($ch, CURLOPT_URL, $url);
  19.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  20.     $exec = curl_exec($ch);
  21.     return $exec;
  22. }
  23.  
  24. function get(string $url, $fiels = false)
  25. {
  26.     global $ch;
  27.     curl_setopt($ch, CURLOPT_URL, $url);
  28.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  29.     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  30.     $exec = curl_exec($ch);
  31.     return $exec;
  32. }
  33.  
  34. for ($x = 1984; $x < 2000; $x++) {
  35.     $name = 'Cvar' . $x;
  36.     echo $name . PHP_EOL;
  37.  
  38.     post('http://rplonegang.000webhostapp.com/ctf/index.php', [
  39.         'name' => $name
  40.     ]);
  41.  
  42.     post('http://rplonegang.000webhostapp.com/ctf/index.php?id=1', [
  43.         'flag' => 'REDUCE{C4ptur3_th3_fl46}'
  44.     ]);
  45.  
  46.     post('http://rplonegang.000webhostapp.com/ctf/index.php?id=6', [
  47.         'flag' => 'REDUCE{5ebu4h_z1p}'
  48.     ]);
  49.  
  50.     post('http://rplonegang.000webhostapp.com/ctf/index.php?id=9', [
  51.         'flag' => 'REDUCE{1n1_fl46_t3rs3mbunyI}'
  52.     ]);
  53.  
  54.     post('http://rplonegang.000webhostapp.com/ctf/index.php?id=3', [
  55.         'flag' => 'REDUCE{tH3_c0mm3nT}'
  56.     ]);
  57.  
  58.     post('http://rplonegang.000webhostapp.com/ctf/index.php?id=4', [
  59.         'flag' => 'REDUCE{3xt3ns10n_is_succ}'
  60.     ]);
  61.  
  62.     get('http://rplonegang.000webhostapp.com/ctf/index.php?logout');
  63. }
  64.  
  65. curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement