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 and 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 = "" + year + ".php";
    alert("Sorry, did you fail already?!");
    window.location.href = "";

Easy, isn’t it?

Don’t worry, be hacking!


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s