Passed using the maths
11 years ago
0
No, I just modified the URL to alert the password.
Oh my God.. that level :DDD
Yeah, I totally did the math. I later found out I could have computed it easily in my console. And I struggled so much finding the c variable. I really wish I could post spoilers here, my story on this one is so funny ^.^
But on this note, I’m interested in learning how you guys manage to view the source-code of the page, since you’re automatically redirected upon closing the prompt. I was lucky and had previously seen a daMage post where he hinted that one could pre-face the URL with “view-source”. But he suggested that it wasn’t very common. I can’t remember the topic of discussion.
Did exactly the same thing haha, but couldn’t find the c variable. So I decided to go on the forums and i realised that there was a much simpler method, which is using the alert variable, but i still want to be able to solve the maths.
I was surprised no one else tried to solve the maths that’s why i asked, also could you explain how to find the c variable please? Because I don’t really understand the c+= (510)2) bit.
To view the source code you have to press ESC just after you hit the cancel button and it’ll leave you on the same page and then you can view the code :)
Oh! That’s a nice :D
Explanation on the c variable will be in a spoiler: >> Well, c+= (510)2) - the math part is simple enough, the parantheses have no role in the outcome, it means 2510 = 100. So c+=100 in java means this: c = c + 100. The problem is this “supposedly” is the declaration of c, therefor it makes no sense to make the variable equal to itself. The only explanation is that c has been declared somewhere else. I realized this immediatly and no-brained ctrl+f. When I saw 500 something results on the characters “c” I kinda gave up :P I looked up and down the entire page for that sneaky c declaration but never found it. (it’s actually not that well hidden at all, I just looked poorly I suppose.) Silly as I am I never considered that being a variable declaration you can easily predict what comes before and after c, for instance: var c = x, or maybe just “c =”/“c=”. If they had hidden it inside a src link however… well that would have been mean :P
@Uhaba
Thanks for the explanation, I finally get it now! :)
11 years ago
0
Well I tried to solve the maths, but that didn’t work, so I ended up doing it the “easy” way.
11 years ago
0
I had no idea that the c variable equalled itself, or that it was declared elsewhere. It took me long enough to figure out that I could use the URL address bar to alert the password.
I have found the “c” and everything else but now when i compute the whole thing in the console i cant see where it displays the result. Or can someone tell me which method to use in firebug to display stuff contained in a variable? Please…
I f I had eight hours to chop down a tree, I would spend the first six hours sharpening my axe…
-i think that i have to use math too. But i don t undestand how i can solve this (it s not write like usual maths language).
a = window.location.host + “”;
b = a.length;
c += ((510)2);
d = String.fromCharCode(c,-(37-Math.floor(1806/13)),Math.sqrt(b-2)27,(b8)-36);
p=prompt(“Password:”,“”);
if (p==d) {
-I know that the solution is if “p==d” ,but i don t undestand for example “b=a.lenght”.
help me pls.
11 years ago | edited 11 years ago
0
antoinemartin826, you don’t need to work out the maths to solve this level, there is a simpler solution. Look at the source code for the variable that the password must equal, then, you could execute javascript code to alert that variables value. :)
You don’t need to worry about variables a or b, the only variable you should be concerned about is d.
As ColdDaVinci Said, in most (if not all javascript) scripts, when ever a var is present, you can alert its value, so the hard thing is to know where the var of the actual password is.
I Hate Signatures.
thks for advices i just red it.
So i tried with this URL:“http://www.hackthis.co.uk/levels/j5.php?pass=p==d”.
But it doesn t work, i tried too with p=d ,pd and it doesn t work too.
I think I m on the good way but it s maybe not at all the fact!! ;-)
So pls just again little help.
hmmm….
well, what you are trying to do is to pass values to the page, and that will not work, it is a javascript missions, now what java script does is that the script is sent to you with in the page source, all the processing is done on YOUR computer, values are stored in YOUR computer. now where are they stored? in the memory of the running browser (RAM used by your browser).
how can you reach it? how about you google “inline javascript”, and do some reading on javascript basics like vars at least.
I Hate Signatures.
Just to make things easier for us and you, go do some reading on javascript and its vars, then do some basic reading on inline javascript.
no offence, but if you kept asking questions that shows you do not have an idea what you are asking about, then i will not help nor answer.
after all the aim of this site is to open your mind and get you learning, not earning points.
well, the earning points part is to give a push in the learning process.
if all you want is points, your search will be in vain, if its learning, go read and comeback when you know something about the thing you want to solve.
I Hate Signatures.
11 years ago
0
Everything that you want to know is there on google. The only thing is you need to ask google the correct question.