What is it? @.@

Here is the place where I record some tactics about wargame, systems, and other security issues.

2013-05-23

Bright Shadows - /dev/null 2: Strange challenge

Description:


When we enter this challenge, it will prompt a window and  asked us to input our name. After doing so, it will show us a welcome banner in the bottom of the web page.


We can start on it now!

Solution:
  1. Like always we start on viewing the source code of the web page first.
  2. It will prompt a alert window like below. Just throw it away.

  3. Find the forms about the username and password in the source code.
    <form name="form1" action="javascript:memCheck()">
    
    <br><br><br><br><br><br><br><br><br>
    <img src="back1.gif">
    <table bgcolor=#505060 cellpadding="4" cellspacing="1" style="font-family=verdana; color=#FFAA00; font-size=12pt; border=solid 3px black; position=absolute; top=240; left=20">
    <tr>
    <td bgcolor=#A0A09B>
    Username:
    </td>
    <td>
    <input type="text" name="username" style="border-top=solid 2px BLACK; border-bottom=solid 2px BLACK; border-right=solid 1px BLACK; border-left=solid 2px BLACK; background=#A0A09B"></td>
    </tr>
    </form>
    

    <form name="form2" action="javascript:memCheck()">
    <tr>
    <td bgcolor=#A0A0B0>
    Password:
    </td>
    <td><input type="password" name="passwrd" style="border-top=solid 2px BLACK; border-bottom=solid 2px BLACK; border-right=solid 1px BLACK; border-left=solid 2px BLACK; background=#A0A0B0"></td>
    <td>
    <input type="button" name="logBtn" value="Log On" onClick="memCheck()" class="stlBtn" onMouseOver="document.form2.logBtn.style.background='#A0A0B0'" onMouseOut="document.form2.logBtn.style.background='black'">
    </td>
    </tr>
    </table>
    </form>
  4. Now, we know that there is a Javascript function named "memCheck" and it will check the validation of our input username and password. 
  5. Where is it? Check the Javascript files which linked in the HTML header part.
    <script language="JavaScript" src="new_user.js"></script>
    
    <script language="JavaScript" src="functions.js"></script>
  6. In function.js file, you will find the details of memCheck function.
    function memCheck()
    {
    var usr=document.form1.username.value;
    var pas=document.form2.passwrd.value;
    var user=usr.toLowerCase();
    var pass=pas.toLowerCase();
    
    for (i=0; i<mem.length; i++)
    {
    var memU= mem[i].toLowerCase();
    var splt= memU.split("^");
    if (user==splt[0] && pass==splt[1])
    {
    window.open(splt[2]);
    } 
    }
    
    }
    
    function openMenu(menuName, state)
    {
    if (navigator.appName=="Microsoft Internet Explorer")
    {
    document.all[menuName].style.visibility= state;
    }
    
    else
    {
    document[menuName].visibility = state;
    }
    
    }
    
    window.defaultStatus="Nighthawks Password ";
  7. In new_user.js file, you will find the username, password and the successful link.
    mem = new Array()
    mem[0] = "youfoundit^yourinnow^youfoundityourinnow.html";
  8. Input the username and password. Well done!

No comments:

Post a Comment