Published by: Blind-Summit, on 2007-08-14 13:06:10
This article will help you complete the 5 java<b></b>script missions. There is no real excuse for ever getting stuck on these missions as the challenges are very very simple given some logical thought. Your best tool is a combination of viewing the java<b></b>script source and a bit of lateral thinking. What is the code actually doing, and how can I manipulate it into doing what I want?
So lets get started with level 1. Remember I said view the source? Your answer is right there. Always view the source as it can tell you a lot of information about a webpage, and how it works and communicates back to the server.
Level 2 did actually take me a little time to complete because I was looking for a more difficult solution! The answer is in the name of the mission - Disable Javascript.
Level 3 -- Lets look at the source again. It seems that we have some maths to do.
CODE :
var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
{
if (x.length == moo)
{
alert("win!");
window.location += "?lvl_password="+x;
} else {
alert("fail D:");
}
}
So when you click "Check Password" you are passing the value of the "pass" input to the check function. If the length of the password is the same as the variable "moo" then you pass! So we need to work out the value of moo. The smart one of you will do the maths and work out the value. The smarter ones can use a java<b></b>script:alert(var); in the address bar to echo out any variable they like. So java<b></b>script:alert(foo); will output 47 to the screen. Yeah - 47 and not 77 - remember the order you perform operations! So you will then have a value for moo and type this number into the password box. Wrong. Look at the function? It doesn't compare the value of the password field, but rather the length. The actual password doesn't matter as long as the length is ok.
Level 4 -- Again, check the source code. The function looks to see if the value entered is equal to ""+RawrRawr+"". This is basically a blank string "" added to the variable RawrRawr and then another blank string on the end. It looks easier like this "" + RarwRawr + "". We can basically say that if x = RawrRawr, then we pass the level. So the value of the variable is set to moo firstly, and then we see the line: "+RawrRawr+" == "hack_this_site"
which makes you think the variable is then set to hack_this_site. The == operator is a boolean test and will not set anything. It returns false!
Level 5 -- the final level for the moment is very simple. The function simply tests the password against an encoded variable. You can try and decode the string, but why not let the browser do that for you. Try to use the CODE :
java<b></b>script:alert(variable);
again! This is almost as easy as level 1.
Cast your vote on this article *Note: the order of the votes has been reversed.
Well the levels are damn easy,you can always use the javascript:void(alert(variable)) method to bypass the calculations and let the computer do them for you!!
Even level 4 can be solved by var=RawrRawr!!!
Level three var=moo
Enjoy
hrm, i\'m pleased peopel actually explaining the missions. =], rather than just spoiling it :p... because all the missions look like they\'re written in javascript.. actually they\'re really in php... And if we generate randome string with php and js, they\'re obviously going to be different.. so the passwords stay constant for now =p
Glad you like the articled. I like to explain things as simply as possible to help explain WHY and not HOW. Because these missions were so simple, it was hard to not give the answers away. I hope to write more when we get more missions.
This site is the collective work of the
HackThisSite staff. Please don't reproduce in part or whole without permission.
Page Generated: Fri, 21 Nov 2008 08:34:41 -0500 Exec:
11 Page loaded in 0.22487 seconds!
good article!continue...