Advertisement
kintol1212

instagram account creator + auto like

Sep 15th, 2018
2,775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.89 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. class curl {
  4.     var $ch, $agent, $error, $info, $cookiefile, $savecookie;  
  5.     function curl() {
  6.         $this->ch = curl_init();
  7.         curl_setopt ($this->ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.1 (KHTML, like Gecko) Chrome/2.0.164.0 Safari/530.1');
  8.         curl_setopt ($this->ch, CURLOPT_HEADER, 1);
  9.         curl_setopt ($this->ch, CURLOPT_RETURNTRANSFER, 1);
  10.         curl_setopt ($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
  11.         curl_setopt ($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
  12.         curl_setopt ($this->ch, CURLOPT_FOLLOWLOCATION,true);
  13.         curl_setopt ($this->ch, CURLOPT_TIMEOUT, 30);
  14.         curl_setopt ($this->ch, CURLOPT_CONNECTTIMEOUT,30);
  15.     }
  16.     function header($header) {
  17.         curl_setopt ($this->ch, CURLOPT_HTTPHEADER, $header);
  18.     }
  19.     function ssl($veryfyPeer, $verifyHost){
  20.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $veryfyPeer);
  21.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $verifyHost);
  22.     }
  23.     function cookies($cookie_file_path) {
  24.         $this->cookiefile = $cookie_file_path;;
  25.         $fp = fopen($this->cookiefile,'wb');fclose($fp);
  26.         curl_setopt ($this->ch, CURLOPT_COOKIEJAR, $this->cookiefile);
  27.         curl_setopt ($this->ch, CURLOPT_COOKIEFILE, $this->cookiefile);
  28.     }
  29.     function proxy($sock) {
  30.         curl_setopt ($this->ch, CURLOPT_HTTPPROXYTUNNEL, true);
  31.         curl_setopt ($this->ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
  32.         curl_setopt ($this->ch, CURLOPT_PROXY, $sock);
  33.     }
  34.     function post($url, $data) {
  35.         curl_setopt($this->ch, CURLOPT_POST, 1);   
  36.         curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
  37.         return $this->getPage($url);
  38.     }
  39.     function data($url, $data, $hasHeader=true, $hasBody=true) {
  40.         curl_setopt ($this->ch, CURLOPT_POST, 1);
  41.         curl_setopt ($this->ch, CURLOPT_POSTFIELDS, http_build_query($data));
  42.         return $this->getPage($url, $hasHeader, $hasBody);
  43.     }
  44.     function get($url, $hasHeader=true, $hasBody=true) {
  45.         curl_setopt ($this->ch, CURLOPT_POST, 0);
  46.         return $this->getPage($url, $hasHeader, $hasBody);
  47.     }  
  48.     function getPage($url, $hasHeader=true, $hasBody=true) {
  49.         curl_setopt($this->ch, CURLOPT_HEADER, $hasHeader ? 1 : 0);
  50.         curl_setopt($this->ch, CURLOPT_NOBODY, $hasBody ? 0 : 1);
  51.         curl_setopt ($this->ch, CURLOPT_URL, $url);
  52.         $data = curl_exec ($this->ch);
  53.         $this->error = curl_error ($this->ch);
  54.         $this->info = curl_getinfo ($this->ch);
  55.         return $data;
  56.     }
  57. }
  58.  
  59. function fetchCurlCookies($source) {
  60.     preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $source, $matches);
  61.     $cookies = array();
  62.     foreach($matches[1] as $item) {
  63.         parse_str($item, $cookie);
  64.         $cookies = array_merge($cookies, $cookie);
  65.     }
  66.     return $cookies;
  67. }
  68.  
  69. function string($length = 15)
  70. {
  71.     $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
  72.     $charactersLength = strlen($characters);
  73.     $randomString = '';
  74.     for ($i = 0; $i < $length; $i++) {
  75.         $randomString .= $characters[rand(0, $charactersLength - 1)];
  76.     }
  77.     return $randomString;
  78. }
  79.  
  80. function fetch_value($str,$find_start,$find_end) {
  81.     $start = @strpos($str,$find_start);
  82.     if ($start === false) {
  83.         return "";
  84.     }
  85.     $length = strlen($find_start);
  86.     $end    = strpos(substr($str,$start +$length),$find_end);
  87.     return trim(substr($str,$start +$length,$end));
  88. }
  89.  
  90. function loop ($socks, $link) {
  91.  
  92.     $curl = new curl();
  93.     $curl->cookies('cookies/'.md5($_SERVER['REMOTE_ADDR']).'.txt');
  94.     $curl->ssl(0, 2);
  95.     $curl->proxy($socks);
  96.     $register = $curl->get('https://www.instagram.com/accounts/emailsignup/');
  97.  
  98.     $cookies = fetchCurlCookies($register);
  99.     $csrftoken = $cookies['csrftoken'];
  100.     $mid = $cookies['mid'];
  101.  
  102.     if ($register) {
  103.  
  104.         $headers = array();
  105.         $headers[] = "accept-language: en-US,en;q=0.9";
  106.         $headers[] = "content-type: application/x-www-form-urlencoded";
  107.         $headers[] = 'cookie: mid='.$mid.'; mcd=3; shbid=13734; rur=FTW; csrftoken='.$csrftoken.'; csrftoken='.$csrftoken.';';
  108.         $headers[] = "referer: https://www.instagram.com/accounts/emailsignup/";
  109.         $headers[] = "user-agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.54";
  110.         $headers[] = "x-csrftoken: ".$csrftoken."";
  111.         $curl->header($headers);
  112.  
  113.         $page_api = file_get_contents('https://randomuser.me/api/');
  114.         $name = fetch_value($page_api, '"first":"','"');
  115.         $domain = array ('@gmail.com','@yahoo.com','@mail.com','@yandex.com','@gmx.de','@t-online.de','@yahoo.co.id','@yahoo.co.uk');
  116.         $random = rand(0,7);
  117.         $email  = string(11).$domain[$random];
  118.         $username = string(9);
  119.         $password = string(8);
  120.  
  121.  
  122.         $page_register = $curl->post('https://www.instagram.com/accounts/web_create_ajax/', 'email='.$email.'&password='.$password.'&username='.$username.'&first_name='.$name.'&seamless_login_enabled=1&tos_version=row&opt_into_one_tap=false');
  123.  
  124.         if (strpos($page_register, '"account_created": true')) {
  125.             echo "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  126.             $data =  "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\r\n";
  127.             $fh = fopen("success.txt", "a");
  128.             fwrite($fh, $data);
  129.             fclose($fh);
  130.  
  131.             $page_login = $curl->post('https://www.instagram.com/accounts/login/ajax/?hl=en', 'username='.$username.'&password='.$password.'&queryParams=%7B%22hl%22%3A%22en%22%7D');
  132.  
  133.             if (strpos($page_login, '"authenticated": false')) {
  134.                 echo "LOGIN FAILED | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  135.                 flush();
  136.                 ob_flush();
  137.             } elseif (strpos($page_login, '"authenticated": true')) {
  138.  
  139.                 $page_profil = $curl->get($link);
  140.                 preg_match_all('/{"__typename":"GraphImage","id":"(.*?)"/s', $page_profil, $mediaid);
  141.  
  142.                 foreach ($mediaid[1] as $value) {
  143.  
  144.                     $like = $curl->post('https://www.instagram.com/web/likes/'.$value.'/like/', null);
  145.  
  146.                     if (strpos($like, '"status": "ok"')) {
  147.                         echo "SUCCESS LIKE | ".$socks." | ".$email." | ".$username." | ".$password." | MediaID: ".$value."\n";
  148.                         flush();
  149.                         ob_flush();
  150.                     } else {
  151.                         echo "ACTION BLOCKED | ".$socks." | ".$email." | ".$username." | ".$password." | MediaID: ".$value."\n";
  152.                         flush();
  153.                         ob_flush();
  154.                     }
  155.  
  156.                 }
  157.  
  158.                
  159.  
  160.             }
  161.  
  162.         } elseif(strpos($page_register, '"account_created": false')) {
  163.             $ip = fetch_value($page_register, '"ip": ["','"]');
  164.             echo "FAILED | ".$socks." | ".$email." | ".$username." | ".$password." | ".$ip."\n";
  165.             flush();
  166.             ob_flush();
  167.         }
  168.  
  169.     } else {
  170.         echo "SOCKS DIE | ".$socks."\n";
  171.         flush();
  172.         ob_flush();
  173.     }
  174. }
  175.  
  176. echo "INSTAGRAM ACCOUNT CREATOR + AUTO LIKE BY: YUDHA TIRA PAMUNGKAS\n";
  177. sleep(1);
  178. echo "Name File Socks (ex: socks.txt): ";
  179. $namefile = trim(fgets(STDIN));
  180. echo "Link (ex: https://www.instagram.com/yudhatira/): ";
  181. $link = trim(fgets(STDIN));
  182. sleep(1);
  183. echo "Please Wait";
  184. sleep(1);
  185. echo ".";
  186. sleep(1);
  187. echo ".";
  188. sleep(1);
  189. echo ".\n";
  190. $file = file_get_contents($namefile) or die ("File Not Found\n");
  191. $socks = explode("\r\n",$file);
  192. $total = count($socks);
  193. echo "Total Socks: ".$total."\n";
  194.  
  195. foreach ($socks as $value) {
  196.     loop($value, $link);
  197. }
  198.  
  199.  
  200.  
  201.  
  202.  
  203. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement