EvilZone
		Community => General discussion => : CyberWarrior  December 09, 2012, 09:49:29 AM
		
			
			- 
				So i got this question in a hacking tourney I participated in my school. And this was the only question I couldn't answer ( and therefore I came 2nd) . So I would appreciate your help if you could answer it :P 
 
 A website has a password form which you need to get past. The source file of the script of the password form looks something like this:
 
 {
 $("#username").css("border", "2px solid red");
 $("#username").css( "background", "#FFFFCC" );
 flag = 1;
 }
 else
 {
 $("#username").css("border", "2px ridge #FFFFFF");
 $("#username").css( "background", "#FFFFFF" );
 }
 
 if(document.getElementById('password').value.length < 1)
 {
 $("#password").css("border", "2px solid red");
 $("#password").css( "background", "#FFFFCC" );
 flag = 1
 }
 else
 {
 $("#password").css("border", "2px ridge #FFFFFF");
 $("#password").css( "background", "#FFFFFF" );
 }
 
 if(flag == 1)
 {
 return false;
 }
 return true;
 }
 
 And the password form looks something like this:
 
 <form action="" method="post" onSubmit="return validateLogin();" >
 <table border="0">
 <tr>
 <td align="right">
 <strong>Username<span class="mandatory">*</span> :</strong>
 </td>
 <td>
 <input type="username" name="username" id="username" style="border:2px ridge #FFFFFF" >
 </td>
 </tr>
 <tr>
 <td align="right">
 <strong>Password<span class="mandatory">*</span> :</strong>
 </td>
 <td>
 <input type="password" name="password" id="password" style="border:2px ridge #FFFFFF" >
 </td>
 </tr>
 <tr>
 <td> </td>
 <td>
 <input type="submit" value="" name="submit" id="submit" style=" border:0; width:57px; height:19px; background-image:url(images/submit_bg.jpg); background-repeat:no-repeat;" >
 </td>
 </tr>
 </table>
 </form>
 
Help Joe get past the password form.
 
 Reply with the answer as soon as possible. And don't just post it, explain it too so that I can understand. Thanks in advance! :D
 
 Staff Edit
 Please use the code tags next time