Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 http_code() {
  20.         return curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
  21.     }
  22.     function error() {
  23.         return curl_error($this->ch);
  24.     }
  25.     function ssl($veryfyPeer, $verifyHost){
  26.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $veryfyPeer);
  27.         curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $verifyHost);
  28.     }
  29.     function cookies($cookie_file_path) {
  30.         $this->cookiefile = $cookie_file_path;;
  31.         $fp = fopen($this->cookiefile,'wb');fclose($fp);
  32.         curl_setopt ($this->ch, CURLOPT_COOKIEJAR, $this->cookiefile);
  33.         curl_setopt ($this->ch, CURLOPT_COOKIEFILE, $this->cookiefile);
  34.     }
  35.     function proxy($sock) {
  36.         curl_setopt ($this->ch, CURLOPT_HTTPPROXYTUNNEL, true);
  37.         curl_setopt ($this->ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
  38.         curl_setopt ($this->ch, CURLOPT_PROXY, $sock);
  39.     }
  40.     function post($url, $data) {
  41.         curl_setopt($this->ch, CURLOPT_POST, 1);   
  42.         curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
  43.         return $this->getPage($url);
  44.     }
  45.     function data($url, $data, $hasHeader=true, $hasBody=true) {
  46.         curl_setopt ($this->ch, CURLOPT_POST, 1);
  47.         curl_setopt ($this->ch, CURLOPT_POSTFIELDS, http_build_query($data));
  48.         return $this->getPage($url, $hasHeader, $hasBody);
  49.     }
  50.     function get($url, $hasHeader=true, $hasBody=true) {
  51.         curl_setopt ($this->ch, CURLOPT_POST, 0);
  52.         return $this->getPage($url, $hasHeader, $hasBody);
  53.     }  
  54.     function getPage($url, $hasHeader=true, $hasBody=true) {
  55.         curl_setopt($this->ch, CURLOPT_HEADER, $hasHeader ? 1 : 0);
  56.         curl_setopt($this->ch, CURLOPT_NOBODY, $hasBody ? 0 : 1);
  57.         curl_setopt ($this->ch, CURLOPT_URL, $url);
  58.         $data = curl_exec ($this->ch);
  59.         $this->error = curl_error ($this->ch);
  60.         $this->info = curl_getinfo ($this->ch);
  61.         return $data;
  62.     }
  63. }
  64.  
  65. function fetchCurlCookies($source) {
  66.     preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $source, $matches);
  67.     $cookies = array();
  68.     foreach($matches[1] as $item) {
  69.         parse_str($item, $cookie);
  70.         $cookies = array_merge($cookies, $cookie);
  71.     }
  72.     return $cookies;
  73. }
  74.  
  75. function string($length = 15)
  76. {
  77.     $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
  78.     $charactersLength = strlen($characters);
  79.     $randomString = '';
  80.     for ($i = 0; $i < $length; $i++) {
  81.         $randomString .= $characters[rand(0, $charactersLength - 1)];
  82.     }
  83.     return $randomString;
  84. }
  85.  
  86. function angka($length = 15)
  87. {
  88.     $characters = '0123456789';
  89.     $charactersLength = strlen($characters);
  90.     $randomString = '';
  91.     for ($i = 0; $i < $length; $i++) {
  92.         $randomString .= $characters[rand(0, $charactersLength - 1)];
  93.     }
  94.     return $randomString;
  95. }
  96.  
  97. function fetch_value($str,$find_start,$find_end) {
  98.     $start = @strpos($str,$find_start);
  99.     if ($start === false) {
  100.         return "";
  101.     }
  102.     $length = strlen($find_start);
  103.     $end    = strpos(substr($str,$start +$length),$find_end);
  104.     return trim(substr($str,$start +$length,$end));
  105. }
  106. function instagram_account_creator($socks) {
  107.     $curl = new curl();
  108.     $curl->cookies('cookies/'.md5($_SERVER['REMOTE_ADDR']).'.txt');
  109.     $curl->ssl(0, 2);
  110.     $curl->proxy($socks);
  111.     $register = $curl->get('https://www.instagram.com/accounts/emailsignup/');
  112.  
  113.     $cookies = fetchCurlCookies($register);
  114.     $csrftoken = $cookies['csrftoken'];
  115.     $mid = $cookies['mid'];
  116.  
  117.     if ($register) {
  118.  
  119.         $headers = array();
  120.         $headers[] = "accept-language: en-US,en;q=0.9";
  121.         $headers[] = "content-type: application/x-www-form-urlencoded";
  122.         $headers[] = 'cookie: mid='.$mid.'; mcd=3; shbid=13734; rur=FTW; csrftoken='.$csrftoken.'; csrftoken='.$csrftoken.';';
  123.         $headers[] = "referer: https://www.instagram.com/accounts/emailsignup/";
  124.         $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";
  125.         $headers[] = "x-csrftoken: ".$csrftoken."";
  126.         $curl->header($headers);
  127.  
  128.         $page_api = file_get_contents('https://randomuser.me/api/');
  129.         $first = fetch_value($page_api, '"first":"','"');
  130.         $last = fetch_value($page_api, '"last":"','"');
  131.         $name = $first.' '.$last;
  132.         $mail = fetch_value($page_api, '"email":"','@example.com"');
  133.         $user = fetch_value($page_api, '"username":"','"');
  134.         $domain = array ('@gmail.com','@yahoo.com','@mail.com','@yandex.com','@gmx.de','@t-online.de','@yahoo.co.id','@yahoo.co.uk');
  135.         $random = rand(0,7);
  136.         $email  = $mail.angka(5).$domain[$random];
  137.         $username = $first.$last.angka(3);
  138.         $password = string(8);
  139.  
  140.  
  141.         $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');
  142.  
  143.         if (strpos($page_register, '"account_created": true')) {
  144.             echo "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  145.             $data =  "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\r\n";
  146.             $fh = fopen("success.txt", "a");
  147.             fwrite($fh, $data);
  148.             fclose($fh);
  149.             flush();
  150.             ob_flush();
  151.         } elseif(strpos($page_register, '"account_created": false')) {
  152.             echo "FAILED | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  153.             flush();
  154.             ob_flush();
  155.         }
  156.  
  157.     } else {
  158.         $data['httpcode'] = $curl->http_code();
  159.         $error = $curl->error();
  160.         echo "".$socks." | ".$error." | Http code : ".$data['httpcode']."\n";
  161.         flush();
  162.         ob_flush();
  163.     }
  164. }
  165.  
  166. function instagram_account_creator_like_follow($socks, $link) {
  167.  
  168.     $curl = new curl();
  169.     $curl->cookies('cookies/'.md5($_SERVER['REMOTE_ADDR']).'.txt');
  170.     $curl->ssl(0, 2);
  171.     $curl->proxy($socks);
  172.     $data['httpcode'] = $curl->http_code();
  173.     $register = $curl->get('https://www.instagram.com/accounts/emailsignup/');
  174.  
  175.     $cookies = fetchCurlCookies($register);
  176.     $csrftoken = $cookies['csrftoken'];
  177.     $mid = $cookies['mid'];
  178.  
  179.     if ($register) {
  180.  
  181.         $headers = array();
  182.         $headers[] = "accept-language: en-US,en;q=0.9";
  183.         $headers[] = "content-type: application/x-www-form-urlencoded";
  184.         $headers[] = 'cookie: mid='.$mid.'; mcd=3; shbid=13734; rur=FTW; csrftoken='.$csrftoken.'; csrftoken='.$csrftoken.';';
  185.         $headers[] = "referer: https://www.instagram.com/accounts/emailsignup/";
  186.         $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";
  187.         $headers[] = "x-csrftoken: ".$csrftoken."";
  188.         $curl->header($headers);
  189.  
  190.         $page_api = file_get_contents('https://randomuser.me/api/');
  191.         $first = fetch_value($page_api, '"first":"','"');
  192.         $last = fetch_value($page_api, '"last":"','"');
  193.         $name = $first.' '.$last;
  194.         $mail = fetch_value($page_api, '"email":"','@example.com"');
  195.         $user = fetch_value($page_api, '"username":"','"');
  196.         $domain = array ('@gmail.com','@yahoo.com','@mail.com','@yandex.com','@gmx.de','@t-online.de','@yahoo.co.id','@yahoo.co.uk');
  197.         $random = rand(0,7);
  198.         $email  = $mail.angka(5).$domain[$random];
  199.         $username = $first.$last.angka(3);
  200.         $password = string(8);
  201.  
  202.         $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');
  203.  
  204.         if (strpos($page_register, '"account_created": true')) {
  205.            
  206.             echo "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  207.             $data =  "SUCCESS CREATE | ".$socks." | ".$email." | ".$username." | ".$password."\r\n";
  208.             $fh = fopen("success.txt", "a");
  209.             fwrite($fh, $data);
  210.             fclose($fh);
  211.  
  212.             $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');
  213.  
  214.             if (strpos($page_login, '"authenticated": false')) {
  215.                 echo "LOGIN FAILED | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  216.                 flush();
  217.                 ob_flush();
  218.             } elseif (strpos($page_login, '"authenticated": true')) {
  219.  
  220.                 $page_profil = $curl->get($link);
  221.  
  222.                 if ($page_profil) {
  223.  
  224.                     preg_match_all('/{"__typename":"GraphImage","id":"(.*?)"/s', $page_profil, $mediaid);
  225.  
  226.                     $id = fetch_value($page_profil, '{"logging_page_id":"profilePage_','"');
  227.                     $follow = $curl->post('https://www.instagram.com/web/friendships/'.$id.'/follow/?hl=id', null);
  228.  
  229.                     if (strpos($follow, '{"result": "following", "status": "ok"}')) {
  230.                         echo "FOLLOW | ".$socks." | ".$email." | ".$username." | ".$password." | ID: ".$id."\n";
  231.                         flush();
  232.                         ob_flush();
  233.                     } else {
  234.                         echo "FOLLOW | ".$socks." | ".$email." | ".$username." | ".$password." | ID: ".$id."\n";
  235.                         flush();
  236.                         ob_flush();
  237.                     }
  238.  
  239.  
  240.                     foreach ($mediaid[1] as $value) {
  241.  
  242.                         $like = $curl->post('https://www.instagram.com/web/likes/'.$value.'/like/', null);
  243.  
  244.                         if (strpos($like, '"status": "ok"')) {
  245.                             echo "SUCCESS LIKE | ".$socks." | ".$email." | ".$username." | ".$password." | MediaID: ".$value."\n";
  246.                             flush();
  247.                             ob_flush();
  248.                         } else {
  249.                             echo "ACTION BLOCKED | ".$socks." | ".$email." | ".$username." | ".$password." | MediaID: ".$value."\n";
  250.                             flush();
  251.                             ob_flush();
  252.                         }
  253.  
  254.                     }
  255.                 }
  256.  
  257.  
  258.             }
  259.  
  260.            
  261.  
  262.         } elseif(strpos($page_register, 'The IP address you are using has been flagged as an open proxy')) {
  263.             $ip = fetch_value($page_register, '{"ip": ["','"]}');
  264.             echo "FAILED | ".$socks." | ".$email." | ".$username." | ".$password." | ".$ip."\n";
  265.             flush();
  266.             ob_flush();
  267.         } elseif (strpos($page_register, 'Enter a valid email address')) {
  268.             echo "EMAIL NOT VALID | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  269.             flush();
  270.             ob_flush();
  271.         } else {
  272.             echo "UNKNOWN | ".$socks." | ".$email." | ".$username." | ".$password."\n";
  273.             flush();
  274.             ob_flush();
  275.         }
  276.  
  277.     } else {
  278.         $error = $curl->error();
  279.         echo "".$socks." | ".$error." | Http code : ".$data['httpcode']."\n";
  280.         flush();
  281.         ob_flush();
  282.     }
  283. }
  284.  
  285. echo
  286. "
  287. ====================================================
  288.  
  289.  
  290.     CREATED BY YUDHA TIRA PAMUNGKAS
  291.   https://www.facebook.com/yudha.t.pamungkas.3
  292.  
  293.  
  294. ====================================================
  295. \n";
  296. echo "LIST TOOLS\n";
  297. echo "[1] INSTAGRAM ACCOUNT CREATOR\n";
  298. echo "[2] INSTAGRAM ACCOUNT CREATOR + LIKE & FOLLOW\n";
  299. echo "Select tools: ";
  300. $list = trim(fgets(STDIN));
  301. if ($list == "") {
  302.     die ("Cannot be blank!\n");
  303. }
  304.  
  305. if ($list == 1) {
  306.     echo "INSTAGRAM ACCOUNT CREATOR\n";
  307.     sleep(1);
  308.     echo "Name file socks (Ex: socks.txt): ";
  309.     $namefile = trim(fgets(STDIN));
  310.     if ($namefile == "") {
  311.         die ("Socks cannot be blank!\n");
  312.     }
  313.     echo "Please wait";
  314.     sleep(1);
  315.     echo ".";
  316.     sleep(1);
  317.     echo ".";
  318.     sleep(1);
  319.     echo ".\n";
  320.     $file = file_get_contents($namefile) or die ("File not found!\n");
  321.     $socks = explode("\r\n",$file);
  322.     $total = count($socks);
  323.     echo "Total socks: ".$total."\n";
  324.  
  325.     foreach ($socks as $value) {
  326.         instagram_account_creator($value);
  327.     }
  328.  
  329. } elseif ($list == 2) {
  330.     echo "INSTAGRAM ACCOUNT CREATOR + LIKE & FOLLOW\n";
  331.     sleep(1);
  332.     echo "Name file socks (Ex: socks.txt): ";
  333.     $namefile = trim(fgets(STDIN));
  334.     if ($namefile == "") {
  335.         die ("Socks cannot be blank!\n");
  336.     }
  337.     echo "Link (Ex: https://www.instagram.com/rakhanandazero/): ";
  338.     $link = trim(fgets(STDIN));
  339.     if ($link == "") {
  340.         die ("Link cannot be blank!\n");
  341.     }
  342.  
  343.     sleep(1);
  344.     echo "Please wait";
  345.     sleep(1);
  346.     echo ".";
  347.     sleep(1);
  348.     echo ".";
  349.     sleep(1);
  350.     echo ".\n";
  351.     $file = file_get_contents($namefile) or die ("File not found!\n");
  352.     $socks = explode("\r\n",$file);
  353.     $total = count($socks);
  354.     echo "Total socks: ".$total."\n";
  355.  
  356.     foreach ($socks as $value) {
  357.         instagram_account_creator_like_follow($value, $link);
  358.     }
  359. } else {
  360.     die ("Command not found!\n");
  361. }
  362.  
  363. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement