I have come across this code in a web page from a CTF game:
function conexion() {
var Password = "unescape(String.fromCharCode%2880%2C%20108%2C%2097%2C%20110%29):KZQWYZLOMNUWC===":
for (i = 0; i < Password.length; i++) {
if (Password[i].indexOf(code1) == 0) {
var TheSplit = Password[i].split(":");
var code1 = TheSplit[0];
var code2 = TheSplit[1];
}
}
}
After working a little bit, I have deobfuscated the Password
line and obtained:
unescape(String.fromCharCode(80, 108, 97, 110)):KZQWYZLOMNUWC===
which was also translated to Password = "Plan:KZQWYZLOMNUWC===";
.
My first reading of the code is that code1 = Plan
and code2 = KZQWYZLOMNUWC
.
But this is not the correct answer. I’m also not sure how the ===
operates here.
May you please give me some insights?