示例#1
0
require_once __ISN_PATH__ . 'functions_template.php';
require_once __ISN_PATH__ . 'functions_challenges.php';
require_once __ISN_PATH__ . 'db_config.php';
require_once __ROOTPATH__ . 'extension.php';
require_once __ROOTPATH__ . 'welcomemessage.php';
process_uri($_SERVER['REQUEST_URI']);
//Process the REQUEST_URI and set the mode and current_page
session_start();
//Start the Session
db_connect();
//Connect to the Database
if (!isset($_SESSION['hs_uname']) && !isset($_SESSION['hs_unique'])) {
    $_SESSION['hs_uname'] = null;
    $_SESSION['hs_unique'] = null;
}
$pwdlist = null;
/* Check if the User has Already Logged in and set the Global */
if (isset($_SESSION['hs_uname']) && isset($_SESSION['hs_unique']) && $_SESSION['hs_uname'] != '' && $_SESSION['hs_unique'] != '') {
    $query = "SELECT user_id, user_pwdset FROM " . USER_TABLE . " WHERE " . "user_name='" . $_SESSION['hs_uname'] . "' AND " . "user_lastsession='" . session_id() . "' AND " . "user_uniqueid='" . $_SESSION['hs_unique'] . "' " . "LIMIT 1";
    $result = $conn->query($query);
    if ($result) {
        if ($result->num_rows == 1) {
            $row = $result->fetch_assoc();
            $user_id = $row['user_id'];
            $pwdlist = get_password($row['user_pwdset']);
            $user_loggedin = true;
        }
    } else {
        msg_die($conn->error, 'D');
    }
}
示例#2
0
function check_user_exists($usn)
{
    global $db_connected;
    global $conn;
    if ($db_connected) {
        $query = "SELECT user_id FROM " . USER_TABLE . " WHERE " . "user_name='" . $usn . "' LIMIT 1";
        $results = $conn->query($query);
        if ($results) {
            if ($results->num_rows == 1) {
                return true;
            } else {
                return false;
            }
        } else {
            msg_die($conn->error, 'D');
        }
    }
    return true;
}
示例#3
0
                 if (!$stop_update) {
                     $_SESSION['hs_ch_complete'] = true;
                     $_SESSION['hs_last_ch'] = $current_challenge;
                     $current_points = $user_totalpoints + $_SESSION['hs_challocatedpts'];
                     if (isset($_SESSION['hs_used_clue'])) {
                         $user_cluestaken++;
                     }
                     if ($current_challenge == 9) {
                         $done = true;
                     }
                     if (isset($done) && $done) {
                         $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . ", " . "user_endtime=" . time() . ", " . "user_alldone=1 WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1";
                     } else {
                         $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . " WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1";
                     }
                     $result = $conn->query($queryupdate) or msg_die($conn->error, 'D');
                 }
             }
         }
     }
 }
 $redtime = sec2min($user_endtime - time());
 $timeleft = sec2arr($user_endtime - time());
 // This function removes all newlines from the generated page.. nice way to obscure stuff?
 function stupid_hack_newlines($str)
 {
     return str_replace(array("\r\n", "\r", "\n"), '', $str);
 }
 ob_start('stupid_hack_newlines');
 if (!isset($_SESSION['hs_challocatedpts'])) {
     $_SESSION['hs_challocatedpts'] = 5 * $current_challenge;
示例#4
0
function get_password($set)
{
    if ($set < 0 || $set > 5) {
        msg_die("Something went wrong");
    }
    $pw[0] = array("", "h4c3krr4ge", "t4pt4p", "rageface", "pro7otype", "herpderp", "hackersarebad99", "klea5thra", "p0werranger", "h4ck3rcr4ck3r");
    $pw[1] = array("", "d0min4tr1x", "squirtle", "surr3eal", "six7y9ine", "chall3nge4ccepted", "phi5hing", "4sthra11", "obv1ou5pwd", "0h4ck5lash1");
    $pw[2] = array("", "herp0derp9", "tinseltown", "cl4ptrap", "f47ality", "t0rr3nts", "h4hah4hacked", "asthr4kle", "b3hindy0uboo", "h4x0r0ck3r");
    $pw[3] = array("", "haryp0tter", "k1ngsand9u33ns", "thr0ne5", "inc3ption", "backtrack", "pur3own4g3", "as7hrakl311", "h4h4h41337", "h4cx0xraf7");
    $pw[4] = array("", "hak3rfr3nd", "fightth3p0wer", "tr0ll0l", "gr33nlantern", "krustykrabz", "gl4d0s", "prom3theus", "yun0giveup", "gr34th4ck5la5h");
    $pw[5] = array("", "d4rknigh72", "h0usemd", "p0rtal", "ch33seburger", "anr0id", "challeng1ngpwd", "prom3theus", "for3veral0ne", "eld3rscr0ll5");
    return $pw[$set];
}
示例#5
0
<?php

define('IN_TRACKER', true);
define('BB_ROOT', './../');
require BB_ROOT . 'common.php';
if (!$tr_cfg['scrape']) {
    msg_die('Please disable SCRAPE!');
}
// Recover info_hash
if (isset($_GET['?info_hash']) && !isset($_GET['info_hash'])) {
    $_GET['info_hash'] = $_GET['?info_hash'];
}
if (!isset($_GET['info_hash']) || strlen($_GET['info_hash']) != 20) {
    msg_die('Invalid info_hash');
}
$info_hash = $_GET['info_hash'];
function msg_die($msg)
{
    if (DBG_LOG) {
        dbg_log(' ', '!die-' . clean_filename($msg));
    }
    $output = bencode(array('min interval' => (int) 1800, 'failure reason' => (string) $msg, 'warning message' => (string) $msg));
    die($output);
}
define('TR_ROOT', './');
require TR_ROOT . 'includes/init_tr.php';
$info_hash_sql = rtrim(DB()->escape($info_hash), ' ');
$row = DB()->fetch_row("\n\t\tSELECT tor.complete_count, snap.seeders, snap.leechers\n\t\tFROM " . BB_BT_TORRENTS . " tor\n\t\tLEFT JOIN " . BB_BT_TRACKER_SNAP . " snap ON (snap.topic_id = tor.topic_id)\n\t\tWHERE tor.info_hash = '{$info_hash_sql}'\n\t\tLIMIT 1\n");
$output['files'][$info_hash] = array('complete' => (int) $row['seeders'], 'downloaded' => (int) $row['complete_count'], 'incomplete' => (int) $row['leechers']);
echo bencode($output);
tracker_exit();
示例#6
0
                    msg_die('Only ' . $tr_cfg['limit_leech_count'] . ' torrent(s) allowed for leeching' . $rating_msg);
                }
            }
        }
        // Limit concurrent IPs
        if ($tr_cfg['limit_concurrent_ips'] && ($tr_cfg['limit_seed_ips'] && $seeder || $tr_cfg['limit_leech_ips'] && !$seeder)) {
            $sql = "SELECT COUNT(DISTINCT ip) AS ips\n\t\t\t\tFROM " . BB_BT_TRACKER . "\n\t\t\t\tWHERE topic_id = {$topic_id}\n\t\t\t\t\tAND user_id = {$user_id}\n\t\t\t\t\tAND seeder = {$seeder}\n\t\t\t\t\tAND ip != '{$ip_sql}'";
            if (!$seeder && $tr_cfg['leech_expire_factor']) {
                $sql .= " AND update_time > " . (TIMENOW - 60 * $tr_cfg['leech_expire_factor']);
            }
            $sql .= "\tGROUP BY topic_id";
            if ($row = DB()->fetch_row($sql)) {
                if ($seeder && $tr_cfg['limit_seed_ips'] && $row['ips'] >= $tr_cfg['limit_seed_ips']) {
                    msg_die('You can seed only from ' . $tr_cfg['limit_seed_ips'] . " IP's");
                } elseif (!$seeder && $tr_cfg['limit_leech_ips'] && $row['ips'] >= $tr_cfg['limit_leech_ips']) {
                    msg_die('You can leech only from ' . $tr_cfg['limit_leech_ips'] . " IP's");
                }
            }
        }
    }
}
// Up/Down speed
$speed_up = $speed_down = 0;
if ($lp_info && $lp_info['update_time'] < TIMENOW) {
    if ($uploaded > $lp_info['uploaded']) {
        $speed_up = ceil(($uploaded - $lp_info['uploaded']) / (TIMENOW - $lp_info['update_time']));
    }
    if ($downloaded > $lp_info['downloaded']) {
        $speed_down = ceil(($downloaded - $lp_info['downloaded']) / (TIMENOW - $lp_info['update_time']));
    }
}