Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- error_reporting(0);
- ignore_user_abort(1);
- date_default_timezone_set('Asia/Jakarta');
- #######################################
- # Clean db & refresh UA 10 #
- # Copyright pamdhani.pratama #
- # https://www.facebook.com/mr.foxdhan #
- #######################################
- include 'config.php';
- $media_id = "1628320862465150355_6089608426";// id media untuk test like
- $ids = mysql_query("SELECT * FROM instagram"); //sesuaikan db mu
- while ($data = mysql_fetch_array($ids)){
- $username = $data['username'];
- $cookies = $data['cookies'];
- $ua = $data['useragent'];
- $idig = $data['id'];
- $pass = $data['password'];
- $likekuy = proccess(1, $ua, 'media/'.$media_id.'/like/', $cookies, generateSignature('{"media_id":"'.$media_id.'"}'));
- $cross = json_decode($likekuy[1]);
- if($cross->message == "checkpoint_required"){
- print $username.'<font color="orange"> checkpoint_required</font><br>';//cek point verif no hp / it was me
- mysql_query("DELETE FROM instagram WHERE username='$username'");
- print cek($username,$pass);
- }else if($cross->message == "login_required"){
- print $username.'<font color="red"> login_required</font><br>'; //login ulang
- mysql_query("DELETE FROM instagram WHERE username='$username'");
- print cek($username,$pass);
- }else if($cross->message == "feedback_required"){
- print $username.'<font color="red"> feedback_required</font><br>'; //block like
- mysql_query("DELETE FROM instagram WHERE username='$username'");
- }else if($cross->status == "ok"){ //sukses buat like status ok
- print $username.'<font color="green"> live</font><br>';
- }
- }
- function cek($username,$password){
- $ua = generate_useragent();
- $date = date("Y-m-d");
- $postq = json_encode(array(
- 'phone_id' => generateUUID(true),
- '_csrftoken' => get_csrftoken(),
- 'username' => $username,
- 'guid' => generateUUID(true),
- 'device_id' => generateUUID(true),
- 'password' => $password,
- 'login_attempt_count' => 0));
- $a = proccess(1, $ua, 'accounts/login/', 0, generateSignature($postq));
- $header = $a[0];
- $a = json_decode($a[1]);
- if($a->status == 'ok'){
- print $username.'<font color="green"> live, cookie diperbarui</font><br>';
- preg_match_all('%Set-Cookie: (.*?);%',$header,$d);$cookie = '';
- for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
- $cookie = json_encode($cookie);
- $id = $a->logged_in_user->pk;
- $query = "UPDATE instagram SET cookies='$cookie' , useragent='$ua' where username='$username'"; ////setting sesuai data
- $set = mysql_query($query);
- }else{
- print $username.'<font color="red"> die, gagal diperbarui, checkpoint_required</font><br>';
- mysql_query("DELETE FROM instagram WHERE username='$username'"); //setting sesuai data
- }
- }
- function proccess($ighost, $useragent, $url, $cookie = 0, $data = 0, $httpheader = array(), $proxy = 0, $userpwd = 0, $is_socks5 = 0){
- $url = $ighost ? 'https://i.instagram.com/api/v1/' . $url : $url;
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 20);
- if($proxy) curl_setopt($ch, CURLOPT_PROXY, $proxy);
- if($userpwd) curl_setopt($ch, CURLOPT_PROXYUSERPWD, $userpwd);
- if($is_socks5) curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- if($httpheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- if($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
- if ($data):
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- endif;
- $response = curl_exec($ch);
- $httpcode = curl_getinfo($ch);
- if(!$httpcode) return false; else{
- $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
- $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
- curl_close($ch);
- return array($header, $body);
- }
- }
- function generateSignature($data){
- $hash = hash_hmac('sha256', $data, '68a04945eb02970e2e8d15266fc256f7295da123e123f44b88f09d594a5902df');
- return 'ig_sig_key_version=4&signed_body='.$hash.'.'.urlencode($data);
- }
- function generate_useragent($sign_version = '10.8.0'){
- $resolusi = array('1080x1776','1080x1920','720x1280', '320x480', '480x800', '1024x768', '1280x720', '768x1024', '480x320');
- $versi = array('GT-N7000', 'SM-N9000', 'GT-I9220', 'GT-I9100');
- $dpi = array('120', '160', '320', '240');
- $ver = $versi[array_rand($versi)];
- 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)';
- }
- function generateUUID($type){
- $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)
- );
- return $type ? $uuid : str_replace('-', '', $uuid);
- }
- function get_csrftoken(){
- $fetch = proccess('si/fetch_headers/', null, null);
- $header = $fetch[0];
- if (!preg_match('#Set-Cookie: csrftoken=([^;]+)#', $fetch[0], $token)) {
- return json_encode(array('result' => false, 'content' => 'Missing csrftoken'));
- } else {
- return substr($token[0], 22);
- }
- }
- function generateDeviceId($seed){
- $volatile_seed = filemtime(__DIR__);
- return 'android-'.substr(md5($seed.$volatile_seed), 16);
- }
- function genWaktu($detik){
- $detik1 = time()-10;
- return "$detik"."_"."$detik1";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement