Saturday 17 October 2015

Solution: CanYouHackIt - Script Challenge 2

Leave a Comment

Onto our next challenge.. This is another similar script challenge we solved before.. But with a little bit more of scripting logic.. So let's begin..

Site: CanYouHackIt (http://canyouhack.it/)
Challenge: Script > Script Challenge 2 > Another Quick One


After people understood that client can also see the javascript on their browser using View Source, they started using javascript's more complex logic to implement password validation.. This one is like that, but comparatively easy to understand..

Now what we have here...

  • var a = "de9f8caa7ea6fe56830925a124d605d4"; //A variable with some values
  • var password = ""; //Another variable, but empty at the moment
  •     
  •     for(var i = 0; i < 20; i++)
  •         password += a.substring((i%3),(i%5)+(i%3));
Above loop calculates the password, it gets the password by manipulating the variable "a".. Now, how can we get what the end result will be after the loop..? The result is necessary because the conditional logic in the script later requires the value of variable "password" to match with our entered password.
I used an online javascript compiler to compile the code snippet given above, and I got the password..
Below is the result screenshot..


So the password is : e9fde9e9f8de99f8de9f9dee9f9f8ce9fde9e9f8


If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment