hint
I would love to change the world, but they won’t give me the source code.
Just to throw in my two cents, if you are using console in either firebug, inspect element or whatever the IE alternative is then you can use:
console.log(variablename);
You actually don’t have to you can use the console in chrome or just the javascript:alert or flabby’s way
hi all
i’ve a question : in javascript level 5 test why when i select cancel button i’m redirected directly to : http://www.hackthis.co.uk/levels/
The script is made that way; basically if you don’t give the correct password, you are redirected to /levels/
- daMage
11 years ago
0
Ok this could be said to be close to being a spoiler so if you don’t want to know then don’t look! >> The first thing you need to do is press the cancel and then the Esc key a fraction after the cancel button. This will hold you on the j5.php page and not push you back to the levels directory. The Javascript you want to find is this script on the source:
You don’t need this bit unless you want to try and work out:
What’s important to you and what you will need is in the next three lines.
Remeber this is javascript. And we know we can see what the cookies contain
just by typing into the url window of the browser javascript:alert(document.cookie);d = String.fromCharCode(c,-(37-Math.floor(1806/13)),Math.sqrt(b-2)27,(b8)-36);
p=prompt(“Password:”,“”);On this next line the code is saying: if ‘p’ is equal to ’d' and ’d' is equal to ‘p’
then do this bit of code: window.location = “/levels/j5.php?pass=”+p;but you need to find out the value of ‘p’ to enter the password which is
contained in ’d' otherwise the code: window.location = “/levels/”;
will be used and the browser will go back to the levels page.if (p==d)
So how could we find out the value of what we need.
If you typed javascript:alert(p); all you would get is a null string.
So what will we need to do pass the level? What do we want to know?
{
window.location = “/levels/j5.php?pass=”+p;
} else {
window.location = “/levels/”;
}
Hope this helps you understand what the script is doing! :)
when the time has come , I shall rise and conquer the world
“People who doesn’t work hard doesn’t have the right to be envious of the people with talent. People fail because they don’t understand the hard work necessary to be successful.”
Yea.
[quote=flabbyrabbit]Just to throw in my two cents, if you are using console in either firebug, inspect element or whatever the IE alternative is then you can use:
Code:
console.log(variablename);[/quote]
11 years ago
0
One of the simplest ways to complete this level is to use the URL bar to alert the variable, you don’t need to solve the maths to do that.
@aborge: You can find them in JavaScript file. :|
I just solved it @freewind1012 found the file and created some code to solve d :)
Finally got it
@midnightclub2: The next time you want to “help”, please make sure that you understand something well. Did you know what you were saying?
Damn this @midnightclub2 seems to be high all time. So far i didn’t understand even a single post of his and I’m quite sure others also haven’t! :/
- @IAmDevil
Its good to be back! :D
@midnightclub2: Do you know why that file has numbers?
10 years ago | edited 10 years ago
0
Use scratchpad (Shift + F4) in Firefox to run that JS code and it will give you the password.
The numbers on that file is automatically generated everytime when a new page is loaded. Therefore, even someone searches every inch in source code, no way he can find the exact JavaScript file with that numbers again.
The next time you want to help, make sure that you are helpful!