Friday, July 6, 2012

Solution for bright-shadows.net : JavaScript - Hash the future!

Solution for Bright-Shadows.net : JavaScript - Hash the Future!

This is the link to the original challenge: http://www.bright-shadows.net/challenges/scripts/js3/index.php
However, you will need to register before you can make an attempt to solve this. 

Quest:
Immediately, we are an alert of "No, no, no. Try it again." Let's just do a quick "view-source" and we can quickly spot the following Javascript.

<script type="text/javascript">
  date = new Date();
  year = date.getYear();
  add  = year;
  for (i = 1; i<= year;i++)
  {
    add +=year+i;
  }
  alert(add);
  if (add == 395425559298)
  {
    alert("Good job! You got it!");
    window.location.href=year+".php";
  }
  else
  {
    alert("No, no, no. Try it again!");
    window.location.href="/hackchallenge.php";
  }
</script>
 As we can see, it's trying to use the year to do some additions and check whether the final is equal to 395425559298.

Well after some tampering of the script, we found out that the value for year must be 513436 in order to solve this.

Cheers
0x4A61636F62
 

No comments:

Post a Comment