· 6 years ago · Jan 24, 2020, 10:28 AM
1<?php
2/* auto create tokopedia account + follow */
3function generateRandomString($length = 10) {
4 $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
5 $charactersLength = strlen($characters);
6 $randomString = '';
7 for ($i = 0; $i < $length; $i++) {
8 $randomString .= $characters[rand(0, $charactersLength - 1)];
9 }
10 return $randomString;
11}
12
13function generateRandomWord($length = 10) {
14 $characters = 'abcdefghijklmnopqrstuvwxyz';
15 $charactersLength = strlen($characters);
16 $randomString = '';
17 for ($i = 0; $i < $length; $i++) {
18 $randomString .= $characters[rand(0, $charactersLength - 1)];
19 }
20 return $randomString;
21}
22
23function getStr($start, $end, $string) {
24 if (!empty($string)) {
25 $setring = explode($start,$string);
26 $setring = explode($end,$setring[1]);
27 return $setring[0];
28 }
29}
30
31function add_dot($str){
32 if ((strlen($str) > 1) && (strlen($str) < 31)) {
33 $ca = preg_split("//",$str);
34 array_shift($ca);
35 array_pop($ca);
36 $head = array_shift($ca);
37 $res = add_dot(join('',$ca));
38 $result = array();
39 foreach($res as $val){
40 $result[] = $head . $val;
41 $result[] = $head . '.' .$val;
42 }
43 return $result;
44 }
45 return array($str);
46}
47
48date_default_timezone_set('Asia/Jakarta');
49$userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36";
50$hitung = "1";
51echo "tokopedia account creator + follower [gmail edition]\nby hillywendyan\n";
52
53
54$emailList = add_dot("xwillhendyan"); // user gmail
55$domain = "@gmail.com"; // bisa pake @googlemail.com
56$password = "123123123"; // pass akun
57$shopID = ""; // shopID tokped
58$shopName = ""; // user tokped
59$host = "{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX";
60$gmailUser = "xwillhendyan@gmail.com"; // gmail mu
61$gmailPass = ""; // pass gmail
62$asu = 0;
63
64
65$jumlahAkun = count($emailList);
66echo "Jumlah Akun: $jumlahAkun";
67
68foreach($emailList as $email){
69$email = $email . $domain;
70echo "\n";
71$cookie = dirname(__FILE__)."/".generateRandomString(64).".".generateRandomString(32);
72//$cookie = dirname(__FILE__) . "/CUKI.WHENDYAN/";
73echo "Creating account $hitung... $email\n";
74do{
75echo "Sending OTP...";
76
77$data = '[{"operationName":"OTPRequest","variables":{"email":"' . $email . '","otpType":"126","mode":"email","otpDigit":4},"query":"query OTPRequest($otpType: String!, $mode: String, $msisdn: String, $email: String, $otpDigit: Int) {\n OTPRequest(otpType: $otpType, mode: $mode, msisdn: $msisdn, email: $email, otpDigit: $otpDigit) {\n success\n message\n errorMessage\n __typename\n }\n}\n"}]';
78$ch = curl_init();
79curl_setopt($ch, CURLOPT_URL, "https://gql.tokopedia.com/");
80curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36");
81curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
82curl_setopt($ch, CURLOPT_HTTPHEADER, array(
83 "Host: gql.tokopedia.com",
84 "Connection: keep-alive",
85 "Content-Length: " . strlen($data),
86 "accept: */*",
87 "X-Device: tokopedia-lite",
88 "X-Source: tokopedia-lite",
89 "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
90 "content-type: application/json",
91 "Origin: https://m.tokopedia.com",
92 "Sec-Fetch-Site: same-site",
93 "Sec-Fetch-Mode: cors",
94 "Referer: https://m.tokopedia.com/register",
95 "Accept-Language: en-US,en;q=0.9,id;q=0.8"
96));
97curl_setopt($ch, CURLOPT_POST, 1);
98curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
99curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
100curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
101curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
102
103$result = curl_exec($ch);
104
105if(strpos($result, "Email telah dikirim")){
106echo " Done!\n";
107}else if(strpos($result, "Anda sudah melakukan 3 kali")){
108echo " Skip!\n";
109$asu = 1;
110break;
111continue;
112}else{
113echo " Failed!\n";
114}
115}while(strpos($result, "Email telah dikirim")==false);
116
117$success = 0;
118
119if($asu==1){
120$asu=0;
121continue;
122}
123
124do{
125echo "Getting OTP...";
126$read = imap_open($host,$gmailUser,$gmailPass);
127$array = imap_search($read,'SUBJECT "Aktivasi Akun Tokopedia"');
128
129if($array!=null){
130 foreach($array as $a){
131 if($success==0){
132 $header = imap_header($read, $a);
133 $html = imap_qprint(imap_fetchbody($read, $a, 1));
134
135 $kodeOTP = getStr('0.96);background-color: #ffffff;border-radius: 8px;text-decoration: none;margin: 0 auto;max-width: 272px;border: 1px solid #e5e7e9;width: 200px;">', '<', $html);
136 echo " $kodeOTP!\n";
137 $success = 1;
138 }
139 echo "Deleting Email... ";
140 imap_delete($read, $a);
141 echo " Done!\n";
142 }
143}else{
144 echo " Failed!\n";
145 $success = 0;
146}
147}while($success==0);
148
149echo "Validating OTP...";
150
151$data = '[{"operationName":"OTPValidate","variables":{"email":"' . $email .'","code":"' . $kodeOTP .'","otpType":"126","mode":"email"},"query":"query OTPValidate($msisdn: String, $code: String!, $otpType: String, $fpData: String, $getSL: String, $email: String, $mode: String) {\n OTPValidate(code: $code, otpType: $otpType, msisdn: $msisdn, fpData: $fpData, getSL: $getSL, email: $email, mode: $mode) {\n success\n message\n errorMessage\n validateToken\n cookieList {\n key\n value\n expire\n __typename\n }\n __typename\n }\n}\n"}]';
152$ch = curl_init();
153curl_setopt($ch, CURLOPT_URL, "https://gql.tokopedia.com/");
154curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36");
155curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
156curl_setopt($ch, CURLOPT_HTTPHEADER, array(
157 "Host: gql.tokopedia.com",
158 "Connection: keep-alive",
159 "Content-Length: " . strlen($data),
160 "accept: */*",
161 "X-Device: tokopedia-lite",
162 "X-Source: tokopedia-lite",
163 "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
164 "content-type: application/json",
165 "Origin: https://m.tokopedia.com",
166 "Sec-Fetch-Site: same-site",
167 "Sec-Fetch-Mode: cors",
168 "Referer: https://m.tokopedia.com/register",
169 "Accept-Language: en-US,en;q=0.9,id;q=0.8"
170));
171curl_setopt($ch, CURLOPT_POST, 1);
172curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
173curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
174curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
175curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
176
177$result = curl_exec($ch);
178if(strpos($result, "Validasi kode verifikasi sukses")){
179$validateToken = getStr('validateToken":"', '"', $result);
180echo " Done!\n";
181}else{
182echo " Failed!\n";
183}
184
185echo "Creating Account $email:$password:$validateToken...";
186
187$data = '[{"operationName":"registerMutation","variables":{"input":{"reg_type":"email","phone":"","fullname":"' . generateRandomWord(8) .'","os_type":"mobile","guest_checkout":"","email":"' . $email . '","password":"' . $password . '","validate_token":"' . $validateToken . '"}},"query":"mutation registerMutation($input: RegisterRequest!) {\n register(input: $input) {\n user_id\n sid\n access_token\n refresh_token\n token_type\n is_active\n action\n errors {\n name\n message\n __typename\n }\n __typename\n }\n}\n"}]';
188$ch = curl_init();
189curl_setopt($ch, CURLOPT_URL, "https://gql.tokopedia.com/");
190curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
191curl_setopt($ch, CURLOPT_HTTPHEADER, array(
192 "Host: gql.tokopedia.com",
193 "Connection: keep-alive",
194 "Content-Length: " . strlen($data),
195 "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
196 "Accounts-Authorization: MTAwMw==e1UT",
197 "content-type: application/json",
198 "accept: */*",
199 "X-Device: tokopedia-lite",
200 "X-Source: tokopedia-lite",
201 "X-TKPD-AKAMAI: register",
202 "Origin: https://m.tokopedia.com",
203 "Sec-Fetch-Site: same-site",
204 "Sec-Fetch-Mode: cors",
205 "Referer: https://m.tokopedia.com/register?ld=",
206 "Accept-Language: en-US,en;q=0.9,id;q=0.8",
207 ));
208curl_setopt($ch, CURLOPT_POST, 1);
209curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
210curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
211curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
212
213$result = curl_exec($ch);
214
215$handle = fopen(dirname(__FILE__)."/akunTokped.txt", 'a');
216if(strpos($result, 'is_active":1')){
217 fwrite($handle, "$email:$password\n");
218 echo " Done!\n";
219 $hitung++;
220}else{
221 echo " Failed!\n";
222 echo $result;
223}
224
225echo "Following $shopName ($shopID)...";
226
227$data = '[{"operationName":"followShop","variables":{"shopID":"' . $shopID . '","action":"follow","adKey":"keyFromShop"},"query":"mutation followShop($shopID: String!, $action: String, $adKey: String) {\n followShop(input: {shopID: $shopID, action: $action, adKey: $adKey}) {\n success\n message\n isFirstTime\n __typename\n }\n}\n"}]';
228$ch = curl_init();
229curl_setopt($ch, CURLOPT_URL, "https://gql.tokopedia.com/");
230curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36");
231curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
232curl_setopt($ch, CURLOPT_HTTPHEADER, array(
233 "Host: gql.tokopedia.com",
234 "Connection: keep-alive",
235 "Content-Length: " . strlen($data),
236 "accept: */*",
237 "X-Source: tokopedia-lite",
238 "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
239 "content-type: application/json",
240 "Origin: https://m.tokopedia.com",
241 "Sec-Fetch-Site: same-site",
242 "Sec-Fetch-Mode: cors",
243 "Referer: https://m.tokopedia.com/$shopName",
244 "Accept-Language: en-US,en;q=0.9,id;q=0.8"
245));
246curl_setopt($ch, CURLOPT_POST, 1);
247curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
248curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
249curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
250curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
251
252$result = curl_exec($ch);
253
254if(strpos($result, "Berhasil follow")){
255 echo " Done!\n";
256}else{
257 echo " Failed!\n";
258}
259
260}
261?>