Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    undefined variable?

    edit: its okay, i figured it out. The person had embedded the password and i had to use javascript injection to find it

    Hello I am having some fun with javascript, and I came upon a site, on the site you have to try to figure out the passwords which are embedded in javascript, now im on the last level but i have no clue whats going. It seems to be an undefined variable. Can anyone point me in the right direction?

    Below is the unaltered code form the site. Thank you.

    Code:
    <html>
      <head>
        <title>
          JavaScript Hacking Challenge - Level 9
        </title>
          <script src="JavaScript"></script>
          <script language="JavaScript">
          <!--
          function checkPassword(passwd) {
            if (passwd == THEPASSWORD)
            {
              alert("Nicely done!");
              location.href = winnerlink;
            }
            else {
              alert("Where is the password?!  I'm viewing the source!");
            }
          }
          //-->
        </script>
      </head>
      <body>
    <H1>JavaScript Hacking Challenge</H1>
    <H1>Level 9</H1>
    <p>
        Enter your password below:<br>
        <form name="passwordForm">
          <input type="password" name="txtpasswd">
          <input type="reset" value="Validate" onClick="checkPassword(passwordForm.txtpasswd.value)">
        </form>
      </body>
    </html>
    Last edited by g-forcewebmedia; 08-25-2006 at 10:11 PM.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it's a trick, see

    the first script call is src=Javascript thereforethat is where you will want to check. i'm not sure if it's a directory or afile, but play around with that.

    <html>
    <head>
    <title>
    JavaScript Hacking Challenge - Level 9
    </title>
    <script src="JavaScript"></script>
    <script language="JavaScript">
    <!--
    function checkPassword(passwd) {
    if (passwd == THEPASSWORD)
    {
    alert("Nicely done!");
    location.href = winnerlink;
    }
    else {
    alert("Where is the password?! I'm viewing the source!");
    }
    }
    //-->
    </script>
    </head>
    <body>
    <H1>JavaScript Hacking Challenge</H1>
    <H1>Level 9</H1>
    <p>
    Enter your password below:<br>
    <form name="passwordForm">
    <input type="password" name="txtpasswd">
    <input type="reset" value="Validate" onClick="checkPassword(passwordForm.txtpasswd.value)">
    </form>
    </body>
    </html>
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •