Saturday 17 October 2015

Solution: CanYouHackIt - Script Challenge 3

Leave a Comment

Advancing to our next challenge in the Script Challenges Set... This time, the difficulty level rises.. It is more complex logic than we have seen before.. Let's try to break it..

Site: CanYouHackIt (http://canyouhack.it/)
Challenge: Script > Script Challenge > Arrays!


So this time, the core logic is like this
- User enters the password
- Script runs a loop to calculate another variable out of entered value of password and a variable already defined
- The Loop runs through each character of the password entered by user and maps it on the variable "keys" to get the position of that character as value for the variable P

See like this
If I entered the password "ABCD"
The loop will take A and map it onto keys and get the position number of "A" in the variable keys - Value received "10".. Added into variable P
current value of P = " 10"

The loop will then take B and map it onto keys again to get the position number of that character in the variable keys - Value received "11" .. added to P
current value of P = " 10 11"

The loop will then take C and map it onto keys again to get the position number of that character in the variable keys - Value received "12" .. added to P
current value of P = " 10 11 12" .. and so on... I hope you understood the basic logic behind the code..

Now, if we want to get the password, we can modify the script in such way that it gives out the password which is required to match exactly to what P has.. below is the modified script..


As we got our password, that is - H4x0rS


If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment