コード例 #1
0
function SkipLoginC($user, $pass)
{
    global $cookie, $domain, $referer, $options, $pauth, $secretkey;
    if (!defined('DOWNLOAD_DIR')) {
        global $options;
        if (substr($options['download_dir'], -1) != '/') {
            $options['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename('depositfiles_ul.php');
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = sha1($user . ':' . $pass);
        $cookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
        $secretkey = $_secretkey;
        if (is_array($cookie) && count($cookie) < 1 || empty($cookie)) {
            return Login($user, $pass);
        }
        $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
        is_page($page);
        if (stripos($page, '/logout.php">Logout</a>') === false) {
            return Login($user, $pass);
        }
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
コード例 #2
0
function SkipLoginC($user, $pass, $filename = 'letitbit_ul.php')
{
    global $cookie, $hash, $maxdays, $secretkey;
    $maxdays = 3;
    // Max days to keep cookies saved
    if (!defined('DOWNLOAD_DIR')) {
        global $options;
        if (substr($options['download_dir'], -1) != '/') {
            $options['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($options['download_dir'], 0, 6) == "ftp://" ? '' : $options['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (array_key_exists($hash, $savedcookies)) {
        if (time() - $savedcookies[$hash]['time'] >= $maxdays * 24 * 60 * 60) {
            return login($user, $pass);
        }
        // Ignore old cookies
        $_secretkey = $secretkey;
        $secretkey = sha1($user . ':' . $pass);
        $cookie = IWillNameItLater($savedcookies[$hash]['cookie']);
        $secretkey = $_secretkey;
        $page = geturl("letitbit.net", 80, "/", 'http://letitbit.net/', $cookie, 0, 0, $_GET["proxy"], $pauth);
        is_page($page);
        if (stripos($page, 'title="Logout">Logout</a>') === false) {
            return login($user, $pass);
        }
        SaveCookies($user, $pass);
        // Update cookies file
        return $page;
    }
    return login($user, $pass);
}
コード例 #3
0
function CookieLogin($user, $pass)
{
    global $cookie, $domain, $referer, $hash, $maxdays, $secretkey, $pauth;
    $filename = 'putlocker_ul.php';
    $maxdays = 7;
    // Max days to keep cookies saved
    if (!defined('DOWNLOAD_DIR')) {
        global $options;
        if (substr($options['download_dir'], -1) != '/') {
            $options['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (array_key_exists($hash, $savedcookies)) {
        if (time() - $savedcookies[$hash]['time'] >= $maxdays * 24 * 60 * 60) {
            return Login($user, $pass);
        }
        // Ignore old cookies
        $_secretkey = $secretkey;
        $secretkey = sha1($user . ':' . $pass);
        $cookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
        $secretkey = $_secretkey;
        if (is_array($cookie) && count($cookie) < 1 || empty($cookie)) {
            return Login($user, $pass);
        }
        $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
        is_page($page);
        if (stripos($page, '>Sign Out</a>') === false) {
            return Login($user, $pass);
        }
        $cookie = GetCookiesArr($page, $cookie);
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
コード例 #4
0
function CookieLogin($user, $pass)
{
    global $domain, $referer, $secretkey, $pauth;
    if (empty($user) || empty($pass)) {
        html_error('Login Failed: User or Password is empty.');
    }
    $user = strtolower($user);
    $filename = 'letitbit_ul.php';
    if (!defined('DOWNLOAD_DIR')) {
        if (substr($GLOBALS['options']['download_dir'], -1) != '/') {
            $GLOBALS['options']['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $testCookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
        $secretkey = $_secretkey;
        if (empty($testCookie) || is_array($testCookie) && count($testCookie) < 1) {
            return Login($user, $pass);
        }
        $page = geturl($domain, 80, '/', $referer, $testCookie, 0, 0, $_GET['proxy'], $pauth);
        is_page($page);
        if (stripos($page, 'title="Logout">Logout</a>') === false) {
            return Login($user, $pass);
        }
        $GLOBALS['cookie'] = GetCookiesArr($page, $testCookie);
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
コード例 #5
0
function CookieLogin($user, $pass)
{
    global $domain, $referer, $secretkey, $pauth;
    if (empty($user) || empty($pass)) {
        html_error('Login Failed: User or Password is empty.');
    }
    $user = strtolower($user);
    $filename = 'keep2share_ul.php';
    if (!defined('DOWNLOAD_DIR')) {
        if (substr($GLOBALS['options']['download_dir'], -1) != '/') {
            $GLOBALS['options']['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $testCookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
        $secretkey = $_secretkey;
        if (empty($testCookie) || is_array($testCookie) && count($testCookie) < 1) {
            return Login($user, $pass);
        }
        $test = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
        if ($test['code'] != 403) {
            k2s_checkErrors($test, 'Login error');
        } else {
            // If session is expired, try to get a updated one from the site with the cookies
            $page = geturl($domain, 80, '/', $referer . 'login.html', $cookie, 0, 0, $_GET['proxy'], $pauth);
            is_page($page);
            $testCookie = GetCookiesArr($page, $testCookie);
            if (stripos($page, '/auth/logout.html">Logout') === false || empty($testCookie['sessid'])) {
                return Login($user, $pass);
            }
            // Test possibly updated session
            $test2 = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
            if ($test2['code'] == 403) {
                return Login($user, $pass);
            }
            k2s_checkErrors($test2, 'Login error');
        }
        $GLOBALS['cookie'] = $testCookie;
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
コード例 #6
0
function SavedLogin($user, $pass)
{
    global $T8, $cookie, $secretkey;
    if (!defined('DOWNLOAD_DIR')) {
        global $options;
        if (substr($options['download_dir'], -1) != '/') {
            $options['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']);
    }
    $user = strtolower($user);
    $filename = DOWNLOAD_DIR . basename('mega_ul.php');
    if (!file_exists($filename) || filesize($filename) <= 6) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $cookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
        $secretkey = $_secretkey;
        if (is_array($cookie) && count($cookie) < 1 || empty($cookie)) {
            return Login($user, $pass);
        }
        $T8['sid'] = $cookie['sid'];
        $T8['user_handle'] = $cookie['user_handle'];
        $T8['master_key'] = base64_to_a32($cookie['master_key']);
        $T8['root_id'] = $cookie['root_id'];
        $rsa_priv_key = explode('/T8\\', $cookie['rsa_priv_key']);
        $test = apiReq(array('a' => 'uq'));
        // I'm using the 'User quota details' request for validating the session id.
        if (is_numeric($test[0]) && $test[0] < 0) {
            if ($test[0] == -15) {
                // Session code expired... We need to get a newer one.
                if (!extension_loaded('bcmath')) {
                    html_error('This plugin needs BCMath extension for login.');
                }
                $T8['sid'] = false;
                // Do not send old sid or it will get '-15' error.
                $res = apiReq(array('a' => 'us', 'user' => $user, 'uh' => $T8['user_handle']));
                if (is_numeric($res[0])) {
                    check_errors($res[0], 'Cannot re-login');
                }
                $T8['sid'] = rsa_decrypt(mpi2bc(base64url_decode($res[0]['csid'])), $rsa_priv_key[0], $rsa_priv_key[1], $rsa_priv_key[2]);
                $T8['sid'] = base64url_encode(substr(strrev($T8['sid']), 0, 43));
                t8ArrToCookieArr();
                SaveCookies($user, $pass);
                // Update cookies file with new SID.
                $cookie = '';
                return;
            }
            check_errors($test[0], 'Cannot validate saved-login');
        }
        SaveCookies($user, $pass);
        // Update last used time.
        $cookie = '';
        return;
    }
    return Login($user, $pass);
}
コード例 #7
0
function CookieLogin($user, $pass)
{
    global $secretkey, $cookie, $referer, $pauth;
    if (empty($user) || empty($pass)) {
        html_error('Login Failed: User or Password is empty.');
    }
    $user = strtolower($user);
    if (!defined('DOWNLOAD_DIR')) {
        global $options;
        if (substr($options['download_dir'], -1) != '/') {
            $options['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename('uploaded_ul.php');
    if (!file_exists($filename) || filesize($filename) <= 6) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $testCookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
        $secretkey = $_secretkey;
        if (empty($testCookie) || is_array($testCookie) && count($testCookie) < 1) {
            return Login($user, $pass);
        }
        $x = 0;
        do {
            $page = geturl('uploaded.net', 80, '/me', $referer . ($x > 0 ? 'me' : ''), $testCookie, 0, 0, $_GET['proxy'], $pauth);
            is_page($page);
            $testCookie = GetCookiesArr($page, $testCookie);
            $x++;
        } while ($x < 6 && substr($page, 9, 3) == '302' && stripos($page, "\nLocation: /me") !== false);
        if (substr($page, 9, 3) != '200') {
            return Login($user, $pass);
        }
        $cookie = $testCookie;
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return;
    }
    return Login($user, $pass);
}