Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
O_o Javascript 15 o_O
O_o Javascript 15 o_O
By ghost | 6750 Reads |
0
0
Again, I got bored so i'm gonna write an article about JS 15, seeing as many people are stuck on it, but when you finish this article, you'll realise how easy it was.. it doesnt deserve 50 points... And i don't care how you rate it, cause myself i hate one challenge articles, if i write one about another JS later, i'll merge them, making a nice article :)
A. Understanding it
As always, we start by viewing the source, and the script is lying there, waiting for you to crack it..
*First off you have SlimTim10 showing off (jk).... and then the function that the button uses to check your password starts.. So the password is definately within this function... Now if you're lazy like me, you directly look at the comparision the script does, to see what the passwords string name is, and make the code output/alert it, you find this big condition line, and you try to get stuff from it, but it doesnt work.. I wont explain that method cause other articles talk about it.
*You read the code more carefully and you find out that "password" is the password you put into the textbox, and a,b,c,etc. are variables containing it's characters and indicating their position in the password. You still have no idea what the password should be, but if you read on, you see the big IF condition, it says that those letters (the ones within the a,b,c,etc variables), placed after each other within the alphabetical order, should form the riddle which says query test mess.. you also notice that riddle has as much characters as the number of a,b,c,etc... Great!! even if you don't know it, you have just solved the challenge!
B. Solving it
let’s take the case of var a, it says:
var a = password.charAT(9)
and if you check in the IF condition, of course considering the order given, var a should be the same as the first letter of riddle , so the 10th letter of the password is [spoiler removed], great! do the same for the rest of the vars and you get a 2-word password, submit it and congratulations!
C. Coding tip
I wont say that in detail cause it would spoil the whole challenge, but, you might as well do a script, where password=riddle, and copy all the declared vars (from the original script) then make it alert them considering the .charAT() order, and it will just give you the password :) Both methods only take 4 minutes anyway.. happy cracking!
D. Notes
_I said 10th letter in part B cause .charAT(0) exists. _never mind the “ + & +“ parts cause + is NULL so this adds nothing to the sequence _Republish wherever you want, just give credit to me :)
Ice0lated(a.k.a god)
Comments
ghost 18 years ago
Cheers for that, I had the variables the wrong way round :| and yeah you are right it is easy once you know how.