Passed using the maths

rushA [xzy123prog]
11 years ago

0

Anyone managed to work out the password by doing the maths?

21replies
7voices
285views
[deleted user]
11 years ago

0

No, I just modified the URL to alert the password.

Uhaba
11 years ago

0

I don’t recall being any advanced Math involved. I’ll just check the level real fast ^.^

Uhaba
11 years ago | edited 11 years ago

0

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.

rushA [xzy123prog]
11 years ago

0

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

Uhaba
11 years ago | edited 11 years ago

0

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

daMage
11 years ago | edited 11 years ago

0

@Uhaba
You can always view the source code by prepending the url with “view-source:”, for example:
view-source:http://google.com/
Edit: copy and paste the url, if you want to try it… The view-source links aren’t accepted by this forum :p

rushA [xzy123prog]
11 years ago

0

@Uhaba
Thanks for the explanation, I finally get it now! :)

[deleted user]
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.

[deleted user]
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.

Uhaba
11 years ago

0

It’s funny you should say that. Alerting the password would probably have been one of my first ideas had I access to the page without a modal dialog box ^.^

Anonymous [Emma281]
11 years ago

0

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…

antoinemartin826
11 years ago

0

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

antoinemartin826
11 years ago

0

sorry not b8) but b8 )

[deleted user]
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.

*********** [ADIGA]
11 years ago

0

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.

antoinemartin826
11 years ago

0

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.

*********** [ADIGA]
11 years ago

0

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.

antoinemartin826
11 years ago

0

So i opened the developper tool and i see the console but there are nothing to write

*********** [ADIGA]
11 years ago

0

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.

antoinemartin826
11 years ago

0

yes thanks for you advices
i m agree with you i m not at all here for to earn points, but i had so difficulty with the 2 last Javascript level.
That i was angry (to me to don t success).But finally i did it thks to your advices, so thks again. ;-)

[deleted user]
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.

You must be logged in to reply to this discussion. Login
1 of 22

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss