Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. error_reporting(0);
  4. ignore_user_abort(1);
  5. date_default_timezone_set('Asia/Jakarta');
  6. #######################################
  7. # Clean db & refresh UA 10 #
  8. # Copyright pamdhani.pratama #
  9. # https://www.facebook.com/mr.foxdhan #
  10. #######################################
  11. include 'config.php';
  12.  
  13. $media_id = "1628320862465150355_6089608426";// id media untuk test like
  14.  
  15. $ids = mysql_query("SELECT * FROM instagram"); //sesuaikan db mu
  16. while ($data = mysql_fetch_array($ids)){
  17.  
  18. $username = $data['username'];
  19. $cookies = $data['cookies'];
  20. $ua = $data['useragent'];
  21. $idig = $data['id'];
  22. $pass = $data['password'];
  23.  
  24. $likekuy = proccess(1, $ua, 'media/'.$media_id.'/like/', $cookies, generateSignature('{"media_id":"'.$media_id.'"}'));
  25. $cross = json_decode($likekuy[1]);
  26.  
  27. if($cross->message == "checkpoint_required"){
  28. print $username.'<font color="orange"> checkpoint_required</font><br>';//cek point verif no hp / it was me
  29. mysql_query("DELETE FROM instagram WHERE username='$username'");
  30. print cek($username,$pass);
  31. }else if($cross->message == "login_required"){
  32. print $username.'<font color="red"> login_required</font><br>'; //login ulang
  33. mysql_query("DELETE FROM instagram WHERE username='$username'");
  34. print cek($username,$pass);
  35. }else if($cross->message == "feedback_required"){
  36. print $username.'<font color="red"> feedback_required</font><br>'; //block like
  37. mysql_query("DELETE FROM instagram WHERE username='$username'");
  38. }else if($cross->status == "ok"){ //sukses buat like status ok
  39. print $username.'<font color="green"> live</font><br>';
  40. }
  41. }
  42. function cek($username,$password){
  43. $ua = generate_useragent();
  44. $date = date("Y-m-d");
  45. $postq = json_encode(array(
  46. 'phone_id' => generateUUID(true),
  47. '_csrftoken' => get_csrftoken(),
  48. 'username' => $username,
  49. 'guid' => generateUUID(true),
  50. 'device_id' => generateUUID(true),
  51. 'password' => $password,
  52. 'login_attempt_count' => 0));
  53. $a = proccess(1, $ua, 'accounts/login/', 0, generateSignature($postq));
  54. $header = $a[0];
  55. $a = json_decode($a[1]);
  56. if($a->status == 'ok'){
  57. print $username.'<font color="green"> live, cookie diperbarui</font><br>';
  58. preg_match_all('%Set-Cookie: (.*?);%',$header,$d);$cookie = '';
  59. for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
  60. $cookie = json_encode($cookie);
  61. $id = $a->logged_in_user->pk;
  62. $query = "UPDATE instagram SET cookies='$cookie' , useragent='$ua' where username='$username'"; ////setting sesuai data
  63. $set = mysql_query($query);
  64. }else{
  65. print $username.'<font color="red"> die, gagal diperbarui, checkpoint_required</font><br>';
  66. mysql_query("DELETE FROM instagram WHERE username='$username'"); //setting sesuai data
  67. }
  68. }
  69. function proccess($ighost, $useragent, $url, $cookie = 0, $data = 0, $httpheader = array(), $proxy = 0, $userpwd = 0, $is_socks5 = 0){
  70. $url = $ighost ? 'https://i.instagram.com/api/v1/' . $url : $url;
  71. $ch = curl_init($url);
  72. curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
  73. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  74. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  75. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  76. curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  77. if($proxy) curl_setopt($ch, CURLOPT_PROXY, $proxy);
  78. if($userpwd) curl_setopt($ch, CURLOPT_PROXYUSERPWD, $userpwd);
  79. if($is_socks5) curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  80. if($httpheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
  81. curl_setopt($ch, CURLOPT_HEADER, 1);
  82. if($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  83. if ($data):
  84. curl_setopt($ch, CURLOPT_POST, 1);
  85. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  86. endif;
  87. $response = curl_exec($ch);
  88. $httpcode = curl_getinfo($ch);
  89. if(!$httpcode) return false; else{
  90. $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  91. $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  92. curl_close($ch);
  93. return array($header, $body);
  94. }
  95. }
  96. function generateSignature($data){
  97. $hash = hash_hmac('sha256', $data, '68a04945eb02970e2e8d15266fc256f7295da123e123f44b88f09d594a5902df');
  98. return 'ig_sig_key_version=4&signed_body='.$hash.'.'.urlencode($data);
  99. }
  100. function generate_useragent($sign_version = '10.8.0'){
  101. $resolusi = array('1080x1776','1080x1920','720x1280', '320x480', '480x800', '1024x768', '1280x720', '768x1024', '480x320');
  102. $versi = array('GT-N7000', 'SM-N9000', 'GT-I9220', 'GT-I9100');
  103. $dpi = array('120', '160', '320', '240');
  104. $ver = $versi[array_rand($versi)];
  105. return 'Instagram '.$sign_version.' Android ('.mt_rand(10,11).'/'.mt_rand(1,3).'.'.mt_rand(3,5).'.'.mt_rand(0,5).'; '.$dpi[array_rand($dpi)].'; '.$resolusi[array_rand($resolusi)].'; samsung; '.$ver.'; '.$ver.'; smdkc210; en_US)';
  106. }
  107. function generateUUID($type){
  108. $uuid = sprintf(
  109. '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
  110. mt_rand(0, 0xffff),
  111. mt_rand(0, 0xffff),
  112. mt_rand(0, 0xffff),
  113. mt_rand(0, 0x0fff) | 0x4000,
  114. mt_rand(0, 0x3fff) | 0x8000,
  115. mt_rand(0, 0xffff),
  116. mt_rand(0, 0xffff),
  117. mt_rand(0, 0xffff)
  118. );
  119.  
  120. return $type ? $uuid : str_replace('-', '', $uuid);
  121. }
  122. function get_csrftoken(){
  123. $fetch = proccess('si/fetch_headers/', null, null);
  124. $header = $fetch[0];
  125. if (!preg_match('#Set-Cookie: csrftoken=([^;]+)#', $fetch[0], $token)) {
  126. return json_encode(array('result' => false, 'content' => 'Missing csrftoken'));
  127. } else {
  128. return substr($token[0], 22);
  129. }
  130. }
  131. function generateDeviceId($seed){
  132. $volatile_seed = filemtime(__DIR__);
  133. return 'android-'.substr(md5($seed.$volatile_seed), 16);
  134. }
  135. function genWaktu($detik){
  136. $detik1 = time()-10;
  137. return "$detik"."_"."$detik1";
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement