Example #1
0
function buildIndex($lang)
{
    $sb = '<!DOCTYPE html><html>' . buildHead() . buildBody($lang) . '</html>';
    print $sb;
}
function uploadImage($username, $password, $photo, $caption)
{
    if (!isset($photo) || !is_file($photo)) {
        die("no photo found !");
    } else {
        // $imageInfo = getimagesize($photo);
        // $width = $imageInfo["width"] ;
        // $height = $imageInfo["height"] ;
        list($width, $height) = getimagesize($photo);
    }
    // Set the caption for the photo
    // $caption = "wat";
    // Define the user agent
    $agent = 'Instagram 7.10.0 Android (23/6.0; 515dpi; 1440x2416; huawei/google; Nexus 6P; angler; angler; en_US)';
    // Define the GuID
    $guid = GenerateGuid();
    // Set the devide ID
    $device_id = "android-" . $guid;
    /* LOG IN */
    // You must be logged in to the account that you wish to post a photo too
    // Set all of the parameters in the string, and then sign it with their API key using SHA-256
    $data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","username":"******","login_attempt_count":"1","password":"******","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($data);
    $data = 'signed_body=' . $sig . '.' . urlencode($data) . '&ig_sig_key_version=4';
    $login = SendRequest('accounts/login/', true, $data, $agent, false);
    preg_match('#Set-Cookie: csrftoken=([^;]+)#', $login[2], $token);
    preg_match('#Set-Cookie: ds_user_id=([^;]+)#', $login[2], $id);
    $userid = $id[1];
    if (strpos($login[1], "Sorry, an error occurred while processing this request.")) {
        echo "Request failed, there's a chance that this proxy/ip is blocked";
    } else {
        if (empty($login[1])) {
            echo "Empty response received from the server while trying to login";
        } else {
            // Decode the array that is returned
            $obj = @json_decode($login[1], true);
            if (empty($obj)) {
                echo "Could not decode the response: " . $body;
            } else {
                // Post the picture
                $boundary = $guid;
                $bodies = [['type' => 'form-data', 'name' => 'upload_id', 'data' => round(microtime(true) * 1000)], ['type' => 'form-data', 'name' => '_uuid', 'data' => $guid], ['type' => 'form-data', 'name' => '_csrftoken', 'data' => $token[1]], ['type' => 'form-data', 'name' => 'photo', 'data' => file_get_contents($photo), 'filename' => basename($photo), 'headers' => ['Content-type: application/octet-stream']]];
                $data = buildBody($bodies, $boundary);
                $post = SendRequest('upload/photo/', true, $data, $agent, true, ['Proxy-Connection: keep-alive', 'Connection: keep-alive', 'Accept: */*', 'Content-type: multipart/form-data; boundary=' . $boundary, 'Accept-Language: en-en', 'Accept-Encoding: gzip, deflate']);
                preg_match('#Set-Cookie: csrftoken=([^;]+)#', $post[2], $token);
                if (empty($post[1])) {
                    echo "Empty response received from the server while trying to post the image";
                } else {
                    // Decode the response
                    $obj = @json_decode($post[1], true);
                    if (empty($obj)) {
                        echo "Could not decode the response";
                    } else {
                        $status = $obj['status'];
                        if ($status == 'ok') {
                            // Remove and line breaks from the caption
                            $caption = preg_replace("/\r|\n/", "", $caption);
                            $media_id = $obj['upload_id'];
                            // Now, configure the photo
                            $data = array('caption' => $caption, 'upload_id' => $media_id, 'source_type' => 3, 'edits' => array('crop_zoom' => 1.0, 'crop_center' => array(0.0, -0.0), 'crop_original_size' => array($width, $height), 'black_pixels_ratio' => 0), 'device' => array('manufacturer' => 'asus', 'model' => 'Nexus 7', 'android_version' => 22, 'android_release' => '5.1'), '_csrftoken' => $token[1], '_uuid' => $guid, '_uid' => $userid);
                            $sig = GenerateSignature(json_encode($data));
                            $new_data = 'signed_body=' . $sig . '.' . urlencode(json_encode($data)) . '&ig_sig_key_version=4';
                            $conf = SendRequest('media/configure/', true, $new_data, $agent, true);
                            if (empty($conf[1])) {
                                echo "Empty response received from the server while trying to configure the image";
                            } else {
                                if (strpos($conf[1], "login_required")) {
                                    echo "You are not logged in. There's a chance that the account is banned";
                                } else {
                                    $obj = @json_decode($conf[1], true);
                                    $status = $obj['status'];
                                    if ($status != 'fail') {
                                        echo "Success";
                                    } else {
                                        echo 'Fail';
                                        echo var_dump($obj);
                                    }
                                }
                            }
                        } else {
                            echo "Status isn't okay";
                            echo var_dump($obj);
                        }
                    }
                }
            }
        }
    }
}
function sendemailE($username, $email, $activationcode)
{
    $e = "*****@*****.**";
    require_once "Mail.php";
    $from = "Activation <*****@*****.**>";
    $to = ${$username} . " <" . $email . ">";
    $subject = "Activation";
    $body = buildBody($username, $email, $activationcode);
    $host = "ssl://smtp.gmail.com";
    //"smtp.gmail.com";
    $port = "465";
    //"587";
    $username = "******";
    $password = "******";
    $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject, 'Content-type' => "text/html", 'charset' => "utf-8");
    $smtp = @Mail::factory('smtp', array('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
    $mail = @$smtp->send($to, $headers, $body);
    if (@PEAR::isError($mail)) {
        //echo("<p>" . $mail->getMessage() .":(". "</p>");
        return false;
    } else {
        //echo '<h1 align="center"><a >activation for  '.$e.'   send to your email</a></h1>';
        return true;
        ?>
	
	
	
	<?php 
    }
}
Example #4
0
            unset($_POST['GRMessage']);
            $boundary = "--Boundary+" . rand(0, 100000);
            if (preg_match("/([\\w\\.\\-]+)(\\@[\\w\\.\\-]+)(\\.[a-z]{2,4})+/i", $_POST['User_Email_Address'])) {
                $fromEmail = "\"{$_POST['User_Name']}\" <{$_POST['User_Email_Address']}>";
            } else {
                $fromEmail = "\"Mr. Gecko's Media\" <*****@*****.**>";
            }
            $headers = "From: {$fromEmail}\r\n";
            $headers .= "X-Mailer: GeckoReporter/{$_POST['GRVersion']}\r\n";
            unset($_POST['GRVersion']);
            $headers .= "MIME-Version: 1.0\r\n";
            $headers .= "Content-Type: multipart/mixed; boundary={$boundary}\r\n\r\n";
            $headers .= "--{$boundary}\r\n";
            $headers .= "Content-Type: text/plain; charset=utf-8\r\n";
            $headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
            $KEYS = array_keys($_POST);
            sort($KEYS);
            for ($i = 0; $i < count($KEYS); $i++) {
                $KEY = $KEYS[$i];
                $NAME = str_replace("_", " ", $KEY);
                $headers .= "{$NAME}: {$_POST[$KEY]}\n";
            }
            if ($message != "") {
                $headers .= "\nThe message\n{$message}\n";
            }
            $headers .= buildBody($_FILES, $boundary);
            $sent = mail($email, $subject, "This is a multipart message, your email client needs to support mime 1.0 in order to read this message.", $headers);
            echo $sent ? "Message Was Sent" : "Message Was Not Sent";
        }
    }
}
Example #5
0
function printReport($cubename_sel, $levels, $result)
{
    $ncols = mysql_num_fields($result);
    print "<table border=1>";
    buildHead($cubename_sel, $levels, $ncols, $result, $query);
    buildBody($ncols, $result);
    print "</table>";
}
Example #6
0
}
if (strpos($login[1], "Sorry, an error occurred while processing this request.")) {
    echo "Request failed, there's a chance that this proxy/ip is blocked";
} else {
    if (empty($login[1])) {
        echo "Empty response received from the server while trying to login";
    } else {
        // Decode the array that is returned
        $obj = @json_decode($login[1], true);
        if (empty($obj)) {
            echo "Could not decode the response: " . $body;
        } else {
            // Post the picture
            $boundary = $guid;
            $bodies = [['type' => 'form-data', 'name' => 'upload_id', 'data' => round(microtime(true) * 1000)], ['type' => 'form-data', 'name' => '_uuid', 'data' => $guid], ['type' => 'form-data', 'name' => '_csrftoken', 'data' => $token[1]], ['type' => 'form-data', 'name' => 'photo', 'data' => file_get_contents($photo), 'filename' => basename($photo), 'headers' => ['Content-type: application/octet-stream']]];
            $data = buildBody($bodies, $boundary);
            $post = SendRequest('upload/photo/', true, $data, $agent, true, ['Proxy-Connection: keep-alive', 'Connection: keep-alive', 'Accept: */*', 'Content-type: multipart/form-data; boundary=' . $boundary, 'Accept-Language: en-en', 'Accept-Encoding: gzip, deflate']);
            preg_match('#Set-Cookie: csrftoken=([^;]+)#', $post[2], $token);
            if (empty($post[1])) {
                echo "Empty response received from the server while trying to post the image";
            } else {
                // Decode the response
                $obj = @json_decode($post[1], true);
                if (empty($obj)) {
                    echo "Could not decode the response";
                } else {
                    $status = $obj['status'];
                    if ($status == 'ok') {
                        // Remove and line breaks from the caption
                        $caption = preg_replace("/\r|\n/", "", $caption);
                        $media_id = $obj['upload_id'];