Can you help me please?
Well, it says checkpass then .value.length == this means the value and the length is equal too, then it says length. So basically its saying the password is to do with length
[SPOILER ALERT]
k. Basically go on the level and in the URL type: Javascript:Alert(length);
this shows you the value the length has to be equal to for the password.
[Pure dumbass section]
-.-“ just type - REMOVED - in the password box
Edit: removed the answer and added spoilertags.
for those, who can’t make “javascript:something” working in the url bar, here’s a tip.
In some browsers there is something called “developer tools” which usually also has a javascript console, that you can use to run javascript commands in the context of that page.
To access developer tools:
[list]
[] In Chrome/Chromium: press ctrl+shift+i
[] In Firefox: press ctrl+shift+k (or use the firebug extension)
[*] In IE: press F12
[/list]
- daMage
I’ve cleared this level yet I’m not sure why. I did this; CTRL+SHIFT+I Then I searched for “password” I continued double clicking on password then the script changed and highlighted “UNDEFINED”. Keyed that in as password and level complete. What just happened? I’m really very new to this.
-syahBMF-
I’m kinda lost here, any pointers will be appreciated.
This is what I found:
if (document.getElementById(“pass”).value.length == length) {
document.location = “j2.php?pass=” + document.getElementById(“pass”).value;
} else {
alert(“Incorrect Password”);
}
[/spoiler]<!- var length = 5;
var x = 3;
var y = 2;
y = Math.sin(118.13);
y = -y;
x = Math.ceil(y);
y++;
y = y+x+x;
y *= (y/2);
y++;
y++;
length = Math.floor(y);
[spoiler]If my math is correct that is 26 -!>
Since the alert happens in the else and the POST in the then part of the conditional it’s safe to assume that the [removed minor spoiler] is irrelevant at that point; [xxx} with [xxx] that [xxx] should trigger said POST function, which didn’t work for me. (tried A-Z typed out) So I substituted 1 for the length reference in the conditional to verify and that works if 1 is provided as pass.length.
However the value is obviously incorrect and I don’t see any reference to the actual value that’s needed.
thx in advance.
Edit: you’re so close I had to remove some spoilers :)
Your math is wrong.
The code doesn’t automatically trigger the submit, but is ran when you click the submit button… I hope this helps.
Edit: also playing with the console in the tools I’ve mentioned a few posts above should be fruitful…
- daMage
if (document.getElementById(“pass”).value.length == length) {
document.location = “j2.php?pass=” + document.getElementById(“pass”).value;
} else {
alert(“Incorrect Password”);
}
[/spoiler]the first line is the important one because here you can see what exactly is checked. if you understand that you have to solve the math:
<!-
[spoiler]
you can just make your own *.html file and copy that into it and use alert to get the length ( alert(length); ) this should work for everyone
or you type javascript:alert(length); in your url bar
-!>
so IF you understand the condition you won’t have any problem.
hint: There is no password in the source code.
all information of this post were previously posted in here so you better read carefully next time :)
hope that helps you dresscode
Magnum Truffle Choclate
Actually everything you need to solve the level was posted in this forum so you don’t have to inspect element nor do you have to delete something. Just take a look at the source code and understand it and you will easily solve this level
EDIT: Sorry for 2x post. Somehow can’t delete the 2nd one and my connection isn’t that good right now
Edit: Second post deleted
Do you know anything about programming and / or Math?
Because it’s not that difficult to complete the level..
So you have read my previous post.. You should just look at the code line by line. And if you see a variable, search for it. Where is it declared, what is it’s value?
What is done with it?
If you understand this, then you should be able to complete the level..
When solving problems, dig at the roots instead of just hacking at the leaves.
11 years ago
0
I have no idea in this. I have completed the level with the password provided all over this thread but still couldn’t understand how someone got it. I know it has something to do with the above mentioned code but I am unable to get it. Can someone please explain what the above code really does. Also please comment if there are multiple passwords for this level or only one.
You should look up JavaScript and maybe calculate what is done there.
Actually you don’t even have to know much about JavaScript but you will have to know how and where to use it.
If you are able to run the script and if you understand what is done with it then you should be able to understand the whole thing.
And I could say that there is more then one password but I’m not sure if that’s really right because there is no password stored somewhere which will be compared to the entered password by the user.
So there is no password and also there are infinite (not really but many) passwords.
When solving problems, dig at the roots instead of just hacking at the leaves.
That’s not really true. Sure there is math in the source code. And if you understand the source code and solved the math then you can complete the level.
Just because you don’t have to do the math for yourself doesn’t mean that there is no math to do..
This may sound funny as I code a lot but I hate maths lol,…. I’m just glad I know how to make a computer do it for me :D
well, guys i did not do math, just logic…
so if blabla == blabla is doing math for you. what can i say??? :D
You said “there is no math to do” that’s not correct that’s all I said.
You may not have to do the math but you can complete the level by solving the math.
Of course there are many ways to solve some levels. You could brute force most of them, but what’s the point?
I think it’s important to understand the source code here and if they do then they will probably do the math.
If you understand JavaScript you of course don’t have to.. but it’s not wrong if you do ;)
When I said there was no math to do, I was just meaning that there was a simplest way to do it.
If Allligator was asking how to do the math it’s maybe because it’s too difficult, I should have said , “you cant try another way” Sorry…
(I was also influenced by the fact that it is the Javascript level and not the math one) let’s keep math for math levels :)