Más de lo mismo 🙂 Aunque ahora el código Javascript está ofuscado con un empaquetador (packer).
Basta con abrir el level2.js y analizar la primera línea:
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('C D(){f a=q.t('u').w;f r=z A(8);f x="";B(f i=0;i<r.g;i++){r[i]=z A()}c(a.g==8){c(a.b(5)=="n"){r[7]=["l","j","k","j","9","1","l","m"];c(a.b(4)=="0"){r[2]=["x","d","e","j"];c(a.b(0)=="3"){r[8]=["s","s","3","j","o","E","k"];c(a.b(3)=="y"){r[6]=["7","5","k","j","n","v","k"];r[0]=["l","j","k","j"];c(a.b(1)=="4"){r[3]=["l","j","4","j"];r[1]=["l","j","k","j"];c(a.b(2)=="s"){r[5]=["l","j","k","j","h","o","p"];c(a.b(6)=="3"){r[4]=["l","j","k","j","2","8","h"];B(f j=0;j<r[7].g;j++){x=x+r[j][j]}c(x.F("e","3")==r[7][0]+r[2][3]+a.b(6)+r[5][3]+"2"+r[8][4]+r[1][2]+r[7][7]){q.t('u').w=a.b(0)+a.b(1)+a.b(2)+a.b(3)+a.b(4)+a.b(5)+a.b(6);G()}}}}}}}}}}',43,43,'|||||||||||charAt|if|||var|length||||||||||document|||getElementById|password||value|||new|Array|for|function|check|S|replace|Login'.split('|'),0,{})) |
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('C D(){f a=q.t('u').w;f r=z A(8);f x="";B(f i=0;i<r.g;i++){r[i]=z A()}c(a.g==8){c(a.b(5)=="n"){r[7]=["l","j","k","j","9","1","l","m"];c(a.b(4)=="0"){r[2]=["x","d","e","j"];c(a.b(0)=="3"){r[8]=["s","s","3","j","o","E","k"];c(a.b(3)=="y"){r[6]=["7","5","k","j","n","v","k"];r[0]=["l","j","k","j"];c(a.b(1)=="4"){r[3]=["l","j","4","j"];r[1]=["l","j","k","j"];c(a.b(2)=="s"){r[5]=["l","j","k","j","h","o","p"];c(a.b(6)=="3"){r[4]=["l","j","k","j","2","8","h"];B(f j=0;j<r[7].g;j++){x=x+r[j][j]}c(x.F("e","3")==r[7][0]+r[2][3]+a.b(6)+r[5][3]+"2"+r[8][4]+r[1][2]+r[7][7]){q.t('u').w=a.b(0)+a.b(1)+a.b(2)+a.b(3)+a.b(4)+a.b(5)+a.b(6);G()}}}}}}}}}}',43,43,'|||||||||||charAt|if|||var|length||||||||||document|||getElementById|password||value|||new|Array|for|function|check|S|replace|Login'.split('|'),0,{}))
Busando packers de Javascript en Google, llegamos a éste (usando «eval(function(p,a,c,k,e,r)» como cadena de búsqueda).
Desempaquetamos y obtenemos código mucho más clarito (donde vemos también que hey_neken metió líneas de código espurio)
function check() {
var a = document.getElementById('password').value;
var r = new Array(8);
var x = "";
for (var i = 0; i < r.length; i++) {
r[i] = new Array()
}
if (a.length == 8) {
if (a.charAt(5) == "n") {
r[7] = ["l", "j", "k", "j", "9", "1", "l", "m"];
if (a.charAt(4) == "0") {
r[2] = ["x", "d", "e", "j"];
if (a.charAt(0) == "3") {
r[8] = ["s", "s", "3", "j", "o", "S", "k"];
if (a.charAt(3) == "y") {
r[6] = ["7", "5", "k", "j", "n", "v", "k"];
r[0] = ["l", "j", "k", "j"];
if (a.charAt(1) == "4") {
r[3] = ["l", "j", "4", "j"];
r[1] = ["l", "j", "k", "j"];
if (a.charAt(2) == "s") {
r[5] = ["l", "j", "k", "j", "h", "o", "p"];
if (a.charAt(6) == "3") {
r[4] = ["l", "j", "k", "j", "2", "8", "h"];
for (var j = 0; j < r[7].length; j++) {
x = x + r[j][j]
}
if (x.replace("e", "3") == r[7][0] + r[2][3] + a.charAt(6) + r[5][3] + "2" + r[8][4] + r[1][2] + r[7][7]) {
document.getElementById('password').value = a.charAt(0) + a.charAt(1) + a.charAt(2) + a.charAt(3) + a.charAt(4) + a.charAt(5) + a.charAt(6);
Login()
}
}
}
}
}
}
}
}
}
} |
function check() {
var a = document.getElementById('password').value;
var r = new Array(8);
var x = "";
for (var i = 0; i < r.length; i++) {
r[i] = new Array()
}
if (a.length == 8) {
if (a.charAt(5) == "n") {
r[7] = ["l", "j", "k", "j", "9", "1", "l", "m"];
if (a.charAt(4) == "0") {
r[2] = ["x", "d", "e", "j"];
if (a.charAt(0) == "3") {
r[8] = ["s", "s", "3", "j", "o", "S", "k"];
if (a.charAt(3) == "y") {
r[6] = ["7", "5", "k", "j", "n", "v", "k"];
r[0] = ["l", "j", "k", "j"];
if (a.charAt(1) == "4") {
r[3] = ["l", "j", "4", "j"];
r[1] = ["l", "j", "k", "j"];
if (a.charAt(2) == "s") {
r[5] = ["l", "j", "k", "j", "h", "o", "p"];
if (a.charAt(6) == "3") {
r[4] = ["l", "j", "k", "j", "2", "8", "h"];
for (var j = 0; j < r[7].length; j++) {
x = x + r[j][j]
}
if (x.replace("e", "3") == r[7][0] + r[2][3] + a.charAt(6) + r[5][3] + "2" + r[8][4] + r[1][2] + r[7][7]) {
document.getElementById('password').value = a.charAt(0) + a.charAt(1) + a.charAt(2) + a.charAt(3) + a.charAt(4) + a.charAt(5) + a.charAt(6);
Login()
}
}
}
}
}
}
}
}
}
}
Siguiendo las comprobaciones de las ramas if, llegamos a:
0 1 2 3 4 5 6 7
3 4 s y 0 n e .
Donde la longitud ha de ser de 8 caracteres, siendo el último de ellos uno cualquiera. Y con esto, llegamos al level3 donde estuvimos un buen rato atascados… a ver qué tal se os da a vosotros 😉