Friday, July 6, 2012

Solution for bright-shadows.net : JavaScript - Often used but easy to solve.

Solution for Bright-Shadows.net : JavaScript - Often used but easy to solve.

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

Quest:
Password


Immediately, we are prompted to enter the password. Let's just do a quick "view-source" and we can quickly spot the following Javascript.

<script type="text/javascript">
  function password () {
    var d1, d2, d3, d4, d5, input;
    d1=window.document.bgColor;
    d2=window.document.linkColor;
    d3=d1.substring (1,5)+d2.substring (1,3);
    d4=d3.toUpperCase ();
    input=prompt("Password:","");
    if (input!=d3 && input!=d4) {
      alert("Are you crazy? Thats so easy!");
      window.location.href="/hackchallenge.php";
    }
    else {
      window.location.href=d3+".php";
    }
  }
</script>
<body onLoad="password()" class="usual" link="#FF9900" bgcolor="#D0D0D0">



As we can see, we are required to have d3 or d4 as password. 
Well, the easy way to solve this challenge is to either manually write out the substring or save the entire page and add the following line of code
alert(d4);
 
right before  
 
input=prompt("Password:",""); 
 
We will see an alert with D0D0FF and that is our answer for this challenge. 

That's pretty easy for everyone to understand. :D


Cheers
0x4A61636F62

No comments:

Post a Comment