Challenge – Reversing Javascript

Hello all again!

Hope all of you are doing well!. Today I bring you a challenge. I was some hours trying to break it, certainly I had found out the answer before but for some reason the access didn’t work and I was struggling on how to beat it for several hours.

Hope you like it because, even when the code is really short, there are different approaches to the problem. You have till the next Friday from now on when I will tell you the three ways I found out to to solve it.

The challenge is easy, which is the page giving us the flag?

the pages challenges.org and comingback.org are not valid domains, just a sample.

Here is the code:

 date = new Date();
 year = date.getYear();
 pass = 1337;
 
 for(i = 1; i <= year; i++)
 {
    pass += year * i * year;
 }
 
 if(pass == 318338237039211050000) 
 {
    alert("Good job!");
    window.location.href = "http://challenges.org/js/12/" + year + ".php";
 }
 else
 {
    alert("Sorry, did you fail already?!");
    window.location.href = "http://www.comingback.org/pages/challenges/";
 }

Easy, isn’t it?

Don’t worry, be hacking!

++Security

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s