HACKERTEST.NET | Level 3: Same Prompt?

Level 3 is all similar to the previous levels. But this level requires some knowledge of HTML as well. When you complete level 2 and come to level 3 it again gives you the same prompt box. So, we can just follow our usual steps and open the source code for this level.

On the very beginning of the page you will find the javascript function pass:

<script LANGUAGE="JavaScript">
function pass()
{
  var pw, Eingabe;
  pw=window.document.alinkColor;
  Eingabe=prompt ("Please enter password");
  if (Eingabe==pw)
  {
    window.location.href=String.fromCharCode(97,98,114,97,101)+".htm";
  }
  else
  {
    alert("Try again");
  }
}
</SCRIPT>

This pass function takes the user input in a variable Eingabe and compares it with another variable pw. So it is now very simple to complete this level if we can find the value of pw. If you see pw is equal to window.document.alinkColor. This represents the same web page we are on with a HTML tag alinkColor.

After searching you will see that in the body tag the a link color is defined.

<body onload=javascript:pass(); alink="#000000">

Just copy the colour value from here and enter it in the prompt box and its done. Good luck!!!

Abhishek Gupta
Follow me
Latest posts by Abhishek Gupta (see all)

Leave a Reply