...

View Full Version : undefined variable?



g-forcewebmedia
08-25-2006, 10:38 PM
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.



<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>

rlemon
08-26-2006, 03:37 PM
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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum