dELTA
March 16th, 2010, 20:40
Hi all,
I have a little interesting reversing exercise in the field of Javascript/DOM for you. It might be very easy for those a little more experienced in this field, but it's confusing enough to annoy me anyway, so in that case, please enlighten me.
A short(ish) background story is that I'm trying to "refill" a pay-card mobile phone with credits, and since a couple of days, the phone company in question has started to demand that customers register an account on their website to be able to do this. So, I think to myself, "that's annoying, but sure, whatever".
Then comes the funny thing. This company (one of Sweden's biggest mobile phone telecom companies...) has made such a huge screw-up on the website, that it is impossible for customers to register these new required accounts, and they haven't managed to fix the stupid thing for two whole days, just asking people to "hold on" with refilling their cards while they are working to resolve this problem, when you call their support... Errr, can you imagine the amounts of money they are losing for every hour their worthless web consultants are sleeping on the job...?
So, anyway, the apparent problem (or at least first problem) seems to be that the stupid application form uses some kind of Javascript client side checking, which in turn has some kind of bug making it reject any and all suggestions for passwords, no matter how secure of compliant with their guidelines. The password boxes just turn red, with a big stop sign next to them, as soon as you type anything in them, and the submit button for the form consequently won't work.
So, I think to myself, ok, I won't let some stupid bug in some crappy client side format validation code stop me, I'll just take a look at the code and bypass it (or even fix their stupid bug for them...).
Then comes the problem. I cannot seem to find any friggin' event handling code whatsoever connected to those textboxes, and still, they obviously actively react to me typing in them, WTF?!
So, the exercise is as simple as:
Exactly how can I locate the Javascript event handling code for these text box controls, using any tool or technique?
No event handling code is defined directly in the HTML code for the form, so I assume it must be assigned dynamically by some other Javascript code somewhere.
I have used both the Firebug debugger and DOM inspector to try to find any event code connected to the controls, without any useful results. I have also searched for any reference to e.g. the "password2" text box, in all script code connected to the page (as reported by both Firebug and the "Web Developer" Firefox extension), but still nothing.
There is some packed Javascript code in the connected script file "http://www.comviq.se/script/s_code.js" though, but my main goal is to dynamically be able to resolve the event code connected to the text boxes, not necessarily to locate the code that assigns it. That's normally the beauty of DHTML, i.e. no matter how people try to obfuscate their HTML code, you can easily "dump" it once it has been "unpacked" for viewing in the browser. That's the exact kind of thing I would like to do for the Javascript event code assigned to these text boxes, and I really think it should be possible, or isn't it, really?
You will find the mystery form at the following URL:
http://www.comviq.se/tanka.html
Search this page for the string "skapa ett h", and click the link that makes up the word starting with the "h" in the end of that string (it contains a Swedish letter that may not be available on your keyboards ("här"
, which is why I don't mention the entire word in the search string), and the application form will show up, having the title "Skapa konto".
The two password text boxes have the following titles:
"Lösenord (minst 6 tecken varav en bokstav och en siffra)" [= "Password (at least 6 characters, out if which one letter and one number)"]
and
"Lösenord igen" [= "Password again"]
And again, the single objective of this exercise is to find the Javascript code that is assigned as an event handler for these textboxes (or any other DOM object), e.g. the code that makes them red and shows the stop sign when you type something in them - using any tool or technique.
Any and all help with this is much appreciated!
PS.
Yes, you can easily bypass the entire client-side checking by forcing the form to submit manually with some injected javascript code or whatever, but that's not the point. What caught my interest was that I was not able to locate the event handling code, and it annoys the hell out of me, so please let's just focus on that.
PS2.
Even if they have fixed the problem (that makes the password boxes red whatever you type) when you take a look at the page, it doesn't matter for this exercise, I would still very much like to know how to locate that event handling code, no matter my original reason for stumbling upon this problem.
I have a little interesting reversing exercise in the field of Javascript/DOM for you. It might be very easy for those a little more experienced in this field, but it's confusing enough to annoy me anyway, so in that case, please enlighten me.
A short(ish) background story is that I'm trying to "refill" a pay-card mobile phone with credits, and since a couple of days, the phone company in question has started to demand that customers register an account on their website to be able to do this. So, I think to myself, "that's annoying, but sure, whatever".
Then comes the funny thing. This company (one of Sweden's biggest mobile phone telecom companies...) has made such a huge screw-up on the website, that it is impossible for customers to register these new required accounts, and they haven't managed to fix the stupid thing for two whole days, just asking people to "hold on" with refilling their cards while they are working to resolve this problem, when you call their support... Errr, can you imagine the amounts of money they are losing for every hour their worthless web consultants are sleeping on the job...?

So, anyway, the apparent problem (or at least first problem) seems to be that the stupid application form uses some kind of Javascript client side checking, which in turn has some kind of bug making it reject any and all suggestions for passwords, no matter how secure of compliant with their guidelines. The password boxes just turn red, with a big stop sign next to them, as soon as you type anything in them, and the submit button for the form consequently won't work.
So, I think to myself, ok, I won't let some stupid bug in some crappy client side format validation code stop me, I'll just take a look at the code and bypass it (or even fix their stupid bug for them...).
Then comes the problem. I cannot seem to find any friggin' event handling code whatsoever connected to those textboxes, and still, they obviously actively react to me typing in them, WTF?!
So, the exercise is as simple as:
Exactly how can I locate the Javascript event handling code for these text box controls, using any tool or technique?
No event handling code is defined directly in the HTML code for the form, so I assume it must be assigned dynamically by some other Javascript code somewhere.
I have used both the Firebug debugger and DOM inspector to try to find any event code connected to the controls, without any useful results. I have also searched for any reference to e.g. the "password2" text box, in all script code connected to the page (as reported by both Firebug and the "Web Developer" Firefox extension), but still nothing.
There is some packed Javascript code in the connected script file "http://www.comviq.se/script/s_code.js" though, but my main goal is to dynamically be able to resolve the event code connected to the text boxes, not necessarily to locate the code that assigns it. That's normally the beauty of DHTML, i.e. no matter how people try to obfuscate their HTML code, you can easily "dump" it once it has been "unpacked" for viewing in the browser. That's the exact kind of thing I would like to do for the Javascript event code assigned to these text boxes, and I really think it should be possible, or isn't it, really?
You will find the mystery form at the following URL:
http://www.comviq.se/tanka.html
Search this page for the string "skapa ett h", and click the link that makes up the word starting with the "h" in the end of that string (it contains a Swedish letter that may not be available on your keyboards ("här"

The two password text boxes have the following titles:
"Lösenord (minst 6 tecken varav en bokstav och en siffra)" [= "Password (at least 6 characters, out if which one letter and one number)"]
and
"Lösenord igen" [= "Password again"]
And again, the single objective of this exercise is to find the Javascript code that is assigned as an event handler for these textboxes (or any other DOM object), e.g. the code that makes them red and shows the stop sign when you type something in them - using any tool or technique.
Any and all help with this is much appreciated!
PS.
Yes, you can easily bypass the entire client-side checking by forcing the form to submit manually with some injected javascript code or whatever, but that's not the point. What caught my interest was that I was not able to locate the event handling code, and it annoys the hell out of me, so please let's just focus on that.

PS2.
Even if they have fixed the problem (that makes the password boxes red whatever you type) when you take a look at the page, it doesn't matter for this exercise, I would still very much like to know how to locate that event handling code, no matter my original reason for stumbling upon this problem.