Advertisement
Guest User

u.php

a guest
Aug 23rd, 2018
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.55 KB | None | 0 0
  1. <?php
  2. class TerminalController{
  3.     function __construct(){
  4.         date_default_timezone_set("Asia/Jakarta");
  5.         $this->date = date("Y-m-d");
  6.         $this->COLOR_NC = "\e[0m";
  7.         $this->COLOR_WHITE = "\e[37m";
  8.         $this->COLOR_BLACK = "\e[0;30m";
  9.         $this->COLOR_BLUE = "\e[34m";
  10.         $this->COLOR_LIGHT_BLUE = "\e[1;34m";
  11.         $this->COLOR_GREEN = "\e[0;32m";
  12.         $this->COLOR_LIGHT_GREEN = "\e[1;32m";
  13.         $this->COLOR_CYAN = "\e[0;36m";
  14.         $this->COLOR_LIGHT_CYAN = "\e[1;36m";
  15.         $this->COLOR_RED = "\e[0;31m";
  16.         $this->COLOR_LIGHT_RED = "\e[1;31m";
  17.         $this->COLOR_PURPLE = "\e[0;35m";
  18.         $this->COLOR_LIGHT_PURPLE = "\e[1;35m";
  19.         $this->COLOR_BROWN = "\e[0;33m";
  20.         $this->COLOR_YELLOW = "\e[33m";
  21.         $this->COLOR_GRAY = "\e[0;30m";
  22.         $this->COLOR_LIGHT_GRAY = "\e[92m";
  23.         $this->COLOR_ORANGE = "\e[33m"; }
  24.         public function instagram($ighost, $useragent, $url, $cookie = 0, $data = 0, $httpheader = array(), $proxy = 0, $userpwd = 0, $is_socks5 = 0){
  25.             $url = $ighost ? 'https://i.instagram.com/api/v1/' . $url : $url;
  26.             $ch = curl_init($url);
  27.             curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
  28.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  29.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  30.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  31.             curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  32.             if($proxy)
  33.                 curl_setopt($ch, CURLOPT_PROXY, $proxy);
  34.             if($userpwd) curl_setopt($ch, CURLOPT_PROXYUSERPWD, $userpwd);
  35.             if($is_socks5) curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  36.             if($httpheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
  37.             curl_setopt($ch, CURLOPT_HEADER, 1);
  38.             if($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  39.             if ($data): curl_setopt($ch, CURLOPT_POST, 1);
  40.                 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  41.             endif; $response = curl_exec($ch);
  42.             $httpcode = curl_getinfo($ch);
  43.             if(!$httpcode)
  44.                 return false;
  45.         else{ $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  46.             $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  47.             curl_close($ch);
  48.             return array($header, $body); } }
  49.             public function generateDeviceId(){ $volatile_seed = filemtime(__DIR__);
  50.                 return 'android-'.substr(md5($volatile_seed), 16); }
  51.                 public function generateSignature($data){ $hash = hash_hmac('sha256', $data, 'b4946d296abf005163e72346a6d33dd083cadde638e6ad9c5eb92e381b35784a');
  52.                 return 'ig_sig_key_version=4&signed_body='.$hash.'.'.urlencode($data); }
  53.                 public function generate_useragent(){
  54.                     $ua ='Instagram 12.0.0.7.91 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
  55.                     return $ua; }
  56.                     public function get_csrftoken(){
  57.                         $fetch = $this->instagram('si/fetch_headers/', null, null);
  58.                         $header = $fetch[0];
  59.                     if (!preg_match('#Set-Cookie: csrftoken=([^;]+)#',
  60.                         $fetch[0], $token)) {
  61.                         return json_encode(array('result' => false, 'content' => 'Missing csrftoken'));
  62.                     }else{
  63.                         return substr($token[0], 22); } }
  64.                         public function generateUUID(){
  65.                             $uuid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) );
  66.                             return str_replace('-', '', $uuid); }
  67.                             public function curl($url, $data=null, $ua=null, $cookie=null){ $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url);
  68.                                 if($data != null){ curl_setopt($c, CURLOPT_POST, true);
  69.                                     curl_setopt($c, CURLOPT_POSTFIELDS, $data); }
  70.                                     curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  71.                                     curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
  72.                                     if($cookie != null){ curl_setopt($c, CURLOPT_COOKIE, $cookie); }
  73.                                     if($ua != null){ curl_setopt($c, CURLOPT_USERAGENT, $ua); }
  74.                                     $hmm = curl_exec($c); curl_close($c);
  75.                                     return $hmm; }
  76.                                     public function InstagramLoginLikergram($username, $password){
  77.                                         $ua = $this->generate_useragent();
  78.                                         $devid = $this->generateDeviceId();
  79.                                         $guid = $this->generateUUID();
  80.                                         $data = $this->instagram(1, $ua, 'accounts/login/', 0, $this->generateSignature('{"device_id":"'.$devid.'","guid":"'.$guid.'","username":"'.$username.'","password":"'.$password.'","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}'));
  81.                                         return $data; }
  82.                                         public function InstagramLoginInstabotlike($username, $password){
  83.                                             $c = curl_init();
  84.                                             curl_setopt($c, CURLOPT_URL, "https://www.instagram.com/accounts/login/ajax/");
  85.                                             curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
  86.                                             curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  87.                                             curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
  88.                                             $data = $this->curl('https://www.instagram.com/');
  89.                                             $csrftoken = preg_match('/"csrf_token":"(.*?)",/', $data, $csrftoken) ? $csrftoken[1] : null;
  90.                                             $rolout = preg_match('/"rollout_hash":"(.*?)",/', $data, $rolout) ? $rolout[1] : null;
  91.                                             curl_setopt($c, CURLOPT_HTTPHEADER, array( 'Host: www.instagram.com', 'X-CSRFToken: '.$csrftoken, 'X-Instagram-AJAX: '.$rolout, 'Content-Type: application/x-www-form-urlencoded', ));
  92.                                             curl_setopt($c, CURLOPT_POSTFIELDS, 'username='.$username.'&password='.$password.'&queryParams=%7B%7D');
  93.                                             curl_setopt($c, CURLOPT_HEADER, 1);
  94.                                             curl_setopt($c, CURLOPT_COOKIE, '');
  95.                                             curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0');
  96.                                             $response = curl_exec($c);
  97.                                             $httpcode = curl_getinfo($c);
  98.                                             if(!$httpcode){ return false;
  99.                                             }else{
  100.                                                 $header = substr($response, 0, curl_getinfo($c, CURLINFO_HEADER_SIZE));
  101.                                                 $body = substr($response, curl_getinfo($c, CURLINFO_HEADER_SIZE));
  102. curl_close($c);
  103. return array($header, $body); } }
  104. public function Dashboard(){
  105.     echo "---------------------------------------------\n";
  106.     echo "".$this->COLOR_YELLOW."Instagram".$this->COLOR_WHITE." Like & Robotlike\n";
  107.     echo "Copyright © 2018 ".$this->COLOR_BLUE."Ramadhani Pratama".$this->COLOR_WHITE."\n";
  108.     echo "---------------------------------------------\n";
  109.     echo " -> 1. ".$this->COLOR_LIGHT_GREEN."Likergram.Net ".$this->COLOR_ORANGE."(Like For Like)".$this->COLOR_WHITE."\n";
  110.     echo "       ".$this->COLOR_LIGHT_CYAN."/statuslfl ".$this->COLOR_ORANGE."(Check status lfl)".$this->COLOR_WHITE."\n";
  111.     echo " -> 2. ".$this->COLOR_LIGHT_GREEN."Instabotlike.Net ".$this->COLOR_ORANGE."(Robotlike)".$this->COLOR_WHITE."\n";
  112.     echo "       ".$this->COLOR_LIGHT_CYAN."/statusbotlike ".$this->COLOR_ORANGE."(Check status botlike)".$this->COLOR_WHITE."\n";
  113.     echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN.""; $option = trim(fgets(STDIN));
  114.     echo "".$this->COLOR_WHITE."";
  115.     if($option == '1'){ $this->ViewLoginLikergram();
  116.     }else
  117.     if($option == '2'){ $this->ViewLoginInstabotlike();
  118.     }else
  119.     if($option =='/statuslfl')
  120.         { $this->ViewStatusLikergram();
  121.         }else if($option =='/statusbotlike'){
  122.             $this->ViewStatusInstabotlike();
  123.         }else{ $this->Dashboard(); } }
  124.         public function ViewLoginLikergram(){
  125.             echo "---------------------------------------------\n";
  126.             echo "Likergram.Net Login\n";
  127.             echo "---------------------------------------------\n";
  128.             echo "".$this->COLOR_LIGHT_GREEN."Userame : ".$this->COLOR_WHITE; $username = trim(fgets(STDIN));
  129.             echo "".$this->COLOR_LIGHT_GREEN."Password : ".$this->COLOR_BLACK; $password = trim(fgets(STDIN));
  130.             echo "\n";
  131.             echo "".$this->COLOR_ORANGE."Please wait checking username/password ...".$this->COLOR_WHITE;
  132.             echo"\n";
  133.             $a = $this->InstagramLoginLikergram($username, $password);
  134.             $header = $a[0]; $a = json_decode($a[1]);
  135.             if($a->status == 'ok')
  136.                 { preg_match_all('%Set-Cookie: (.*?);%',$header,$d);
  137.             $cookie = ''; for($o=0;$o<count($d[0]);
  138.             $o++)$cookie.=$d[1][$o].";";
  139.             $userid = $a->logged_in_user->pk;
  140.             $username = $a->logged_in_user->username;
  141.             echo "\n".$this->COLOR_ORANGE."Getting cookies...".$this->COLOR_WHITE; $this->curl('https://www.likergram.net/apiCookie.php?id='.$userid.'&username='.$username.'&password='.$password.'&cookie='.urlencode($cookie));
  142.             echo"\n";
  143.             echo"\n";
  144.             echo "".$this->COLOR_WHITE."---Your autolike is activated.----";
  145.             echo"\n";
  146.             echo "\nIP : ".$this->COLOR_ORANGE."".$this->curl('https://www.instabotlike.net/lib/ip.php')."".$this->COLOR_WHITE;
  147.             echo "\nStatus : ".$this->COLOR_LIGHT_GREEN."True".$this->COLOR_WHITE;
  148.             echo "\nUserID : ".$userid;
  149.             echo "\nUsername : ".$username;
  150.             echo"\n";
  151.             echo $this->COLOR_WHITE."".$this->COLOR_ORANGE."\nRelogin?".$this->COLOR_WHITE."y/n";
  152.             echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN.""; $option = trim(fgets(STDIN)); if($option == 'y'){
  153.             echo $this->COLOR_WHITE; $this->ViewLoginLikergram(); }else{ echo $this->COLOR_WHITE; $this->Dashboard(); } }else{
  154.                 echo "\nError : ".$this->COLOR_RED."Username/password incorret.".$this->COLOR_WHITE;
  155.                 echo"\n";
  156.                 echo"\n";
  157.                 echo "".$this->COLOR_WHITE."---Your autolike is not activated.----";
  158.                 echo"\n";
  159.                 echo "\nIP : ".$this->COLOR_ORANGE."".$this->curl('https://www.instabotlike.net/lib/ip.php')."".$this->COLOR_WHITE;
  160.                 echo "\nStatus : ".$this->COLOR_RED."False".$this->COLOR_WHITE;
  161.                 echo "\nUserID : null";
  162.                 echo "\nUsername : ".$username;
  163.                 echo"\n";
  164.                 echo $this->COLOR_ORANGE."\nRelogin?".$this->COLOR_WHITE."y/n";
  165.                 echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN."";
  166.                 $option = trim(fgets(STDIN)); if($option == 'y'){
  167.                     echo $this->COLOR_WHITE; $this->ViewLoginLikergram();
  168.                 }else{ echo $this->COLOR_WHITE; $this->Dashboard(); } } }
  169.                 public function ViewLoginInstabotlike(){
  170.                     echo "---------------------------------------------\n";
  171.                     echo "Instabotlike.Net Login\n"; echo "---------------------------------------------\n";
  172.                     echo "".$this->COLOR_LIGHT_GREEN."Userame : ".$this->COLOR_WHITE; $username = trim(fgets(STDIN));
  173.                     echo "".$this->COLOR_LIGHT_GREEN."Password : ".$this->COLOR_BLACK; $password = trim(fgets(STDIN));
  174.                     echo "\n";
  175.                     echo "".$this->COLOR_ORANGE."Please wait checking username/password ...".$this->COLOR_WHITE;
  176.                     echo"\n"; $login = $this->InstagramLoginInstabotlike($username,$password);
  177.                     $status = preg_match('/"authenticated": (.*?),/', $login[1], $status) ? $status[1] : null; if($status == 'false'){
  178.                         echo"\n";
  179.                         echo "\nError : ".$this->COLOR_RED."Username/password incorret.".$this->COLOR_WHITE;
  180.                         echo"\n";
  181.                         echo"\n";
  182.                         echo "---Your botlike is not activated.----";
  183.                         echo"\n";
  184.                         echo "\nIP : ".$this->COLOR_ORANGE."".$this->curl('https://www.instabotlike.net/lib/ip.php')."".$this->COLOR_WHITE;
  185.                         echo "\nStatus : ".$this->COLOR_RED."False".$this->COLOR_WHITE;
  186.                         echo "\nUserID : null";
  187.                         echo "\nUsername : ".$username;
  188.                         echo "\nBio : null";
  189.                         echo"\n";
  190.                         echo $this->COLOR_ORANGE."\nRelogin?".$this->COLOR_WHITE."y/n";
  191.                         echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN.""; $option = trim(fgets(STDIN)); if($option == 'y'){
  192.                             echo $this->COLOR_WHITE; $this->ViewLoginInstabotlike(); }else{
  193.                                 echo $this->COLOR_WHITE; $this->Dashboard(); } }else{
  194.                                     echo "\n".$this->COLOR_ORANGE."Getting cookies...".$this->COLOR_WHITE; preg_match_all('%Set-Cookie: (.*?);%',$login[0],$d);$cookie = ''; for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
  195.                                     $data = $this->curl('https://www.instagram.com/', 0, 0, $cookie);
  196.                                     $user_api = preg_match('/window._sharedData = (.*?);<\/script>/', $data, $user_api) ? $user_api[1] : null;
  197.                                     $user = json_decode($user_api);
  198.                                     $userid = @$user->config->viewer->id; $username = @$user->config->viewer->username;
  199.                                     $bio = @$user->config->viewer->biography;
  200.                                     $this->curl('https://www.instabotlike.net/apiCookie.php?cookie='.$cookie);
  201.                                     echo"\n";
  202.                                     echo"\n";
  203.                                     echo "".$this->COLOR_WHITE."---Your botlike is activated.----";
  204.                                     echo"\n";
  205.                                     echo "\nIP : ".$this->COLOR_ORANGE."".$this->curl('https://www.instabotlike.net/lib/ip.php')."".$this->COLOR_WHITE;
  206.                                     echo "\nStatus : ".$this->COLOR_LIGHT_GREEN."True".$this->COLOR_WHITE;
  207.                                     echo "\nUserID : ".$userid;
  208.                                     echo "\nUsername : ".$username;
  209.                                     echo "\nBio : ".$bio;
  210.                                     echo"\n";
  211.                                     echo $this->COLOR_WHITE."".$this->COLOR_ORANGE."\nRelogin?".$this->COLOR_WHITE."y/n";
  212.                                     echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN."";
  213.                                     $option = trim(fgets(STDIN)); if($option == 'y'){ echo $this->COLOR_WHITE; $this->ViewLoginInstabotlike(); }else{
  214.                                         echo $this->COLOR_WHITE; $this->Dashboard(); } } }
  215.                                         public function ViewStatusLikergram(){ echo "---------------------------------------------\n";
  216.                                         echo "Check Status Likergram.Net\n";
  217.                                         echo "---------------------------------------------\n";
  218.                                         echo "".$this->COLOR_LIGHT_GREEN."Username : ".$this->COLOR_WHITE;
  219.                                         $username = trim(fgets(STDIN));
  220.                                         echo "\n";
  221.                                         echo "".$this->COLOR_ORANGE."Please wait checking status ...".$this->COLOR_WHITE;
  222.                                         echo"\n";
  223.                                         echo $this->COLOR_ORANGE."Check again?".$this->COLOR_WHITE."y/n";
  224.                                         echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN."";
  225.                                         $option = trim(fgets(STDIN)); if($option == 'y'){
  226.                                             echo $this->COLOR_WHITE; $this->ViewStatusLikergram(); }else{
  227.                                                 echo $this->COLOR_WHITE; $this->Dashboard(); } } public function ViewStatusInstabotlike(){
  228.                                                     echo "---------------------------------------------\n";
  229.                                                     echo "Check Status Instabotlike.Net\n";
  230.                                                     echo "---------------------------------------------\n";
  231.                                                     echo "".$this->COLOR_LIGHT_GREEN."Username : ".$this->COLOR_WHITE;
  232.                                                     $username = trim(fgets(STDIN)); echo "\n";
  233.                                                     echo "".$this->COLOR_ORANGE."Please wait checking status ...".$this->COLOR_WHITE;
  234.                                                     echo"\n";
  235.                                                     echo $this->COLOR_ORANGE."Check again?".$this->COLOR_WHITE."y/n";
  236.                                                     echo "\nSelect option : ".$this->COLOR_LIGHT_GREEN."";
  237.                                                     $option = trim(fgets(STDIN));
  238.                                                     if($option == 'y'){
  239.                                                         echo $this->COLOR_WHITE;
  240.                                                         $this->ViewStatusLikergram(); }else{
  241.                                                             echo $this->COLOR_WHITE;
  242.                                                             $this->Dashboard(); } } }
  243.                                                             $open = new TerminalController();
  244.                                                             echo $open->Dashboard();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement