G
George Hester
I had a Windows 2000 Server that was serving ASPs. One time on my logon
page I noticed my JavaScripting was messed up. There were unnatural
characters in it. One moment the page was without errors the next it was
erroring. As I was inspecting the page to figure out was wrong I noticed the
<SCRIPT type="text/javascript" had some starnge stuff in it. Anyway I
corrected it thought for a bit about what might have happened and just
chalked it up to FrontPage 2003 and its tendency to mess with pages. Now I
know some may disagree with this but a very simple test you can try to show
that it does just that is try to change the title atrribute for the
FrontPage Hit counter. You can do it outside of the editor but as soon as
you open the page where the counter exists in FrontPage the title attribute
will change back to "Hit Counter." So it's not too hard to verify that
FrontPage CAN and DOES do this.
Now after I changed to Wuindows 2000 Professional to serve ASP, I noticed
another one of my pages throwing an error. A long time since the issue
above occurred. The page ASP was fine and then it wasn't. So I went
through the page trying to zero in on what was the problem. Again it turned
out some JavaScript was messed up. But this time I did not correct it. I
have left it so you can see what "something" did and again I suspect
FrontPage.
Here is what happened:
<script language="javascript" type="text/javascript">
<!-- Begin
function fnTrackMouse(){
if (!event)
event = window.event;
if (ie5 || ns6){
oNotice.innerText='Coords: ('+10*((event.clientX+docRef.scrollLeft)/10)+',
'+10*((event.clientY+docRef.scrollTop)/10)+')';
document.all.floattrack.style.visibility = 'visible';
}
}
// End -->
</script>
I have this in a page and you can assume all this works. All it does is add
text to a floating div which is just the cursor position of the mouse as it
moves about the page. But now I would like you to look at what happened
through nothing done on my part. In fact I don't know what it is:
<script language="javascript" type="text/javascript">
<!-- Begin
function fnTrackMouse(){
if (!event)
event = window.event;
if (docRef)
oNotice.innerText="Coords: ("+10*((event.clientX+docRef.scrollLeft)/10)+",
"+10*((event.clientY+docRef.scrollTop)/10)+ ")";
document.all.floattrack.style.visibility = "visible";
}
// End -->
</script>
Looks almost exactly the same doesn't it? But it is NOT and in fact the
change leads to an error in the browser. No it is not the use of " in the
second instead of ' as in the first. Something else. Look at the end of
the oNotice.innerText statement. Almost at the very end. You will see what
looks like to have spaces here /10)+ ")";
What I just wrote is as different as night is from day from what really
appears there; looking at the ASP in Notepad What really appears there as
shown in Notepad will not copy here. But what is actually there are two
characters áá. So in fact what were are left with is an invalid Javascript
statement. So this is what it looks like:
oNotice.innerText="Coords: ("+10*((event.clientX+docRef.scrollLeft)/10)+",
"+10*((event.clientY+docRef.scrollTop)/10)+áá")";
in Notepad.
So do you really think a hacker has nothing better to do than this? Or that
I just woke up one day and said, "Hey I think I'll screw up my JavaScripting
and throw this áá in somewhere nice.?"
No. Either FrontPage does this or maybe IIS 5.0. I don't know. But I do
know it happens FrontPage does do stuff like this (Like the Hit Counter
issue above) and since it does I am suscpicous.
There is actually more issues with the second rendition above but it is not
important to list them all nor can I really identify them. I just know if I
retype everything after:
10*((event.clientY+docRef.scrollTop)/10)+ ")";
Then the page is fixed. Just retype it exactly as you see it above except
for the spaces (áá).
page I noticed my JavaScripting was messed up. There were unnatural
characters in it. One moment the page was without errors the next it was
erroring. As I was inspecting the page to figure out was wrong I noticed the
<SCRIPT type="text/javascript" had some starnge stuff in it. Anyway I
corrected it thought for a bit about what might have happened and just
chalked it up to FrontPage 2003 and its tendency to mess with pages. Now I
know some may disagree with this but a very simple test you can try to show
that it does just that is try to change the title atrribute for the
FrontPage Hit counter. You can do it outside of the editor but as soon as
you open the page where the counter exists in FrontPage the title attribute
will change back to "Hit Counter." So it's not too hard to verify that
FrontPage CAN and DOES do this.
Now after I changed to Wuindows 2000 Professional to serve ASP, I noticed
another one of my pages throwing an error. A long time since the issue
above occurred. The page ASP was fine and then it wasn't. So I went
through the page trying to zero in on what was the problem. Again it turned
out some JavaScript was messed up. But this time I did not correct it. I
have left it so you can see what "something" did and again I suspect
FrontPage.
Here is what happened:
<script language="javascript" type="text/javascript">
<!-- Begin
function fnTrackMouse(){
if (!event)
event = window.event;
if (ie5 || ns6){
oNotice.innerText='Coords: ('+10*((event.clientX+docRef.scrollLeft)/10)+',
'+10*((event.clientY+docRef.scrollTop)/10)+')';
document.all.floattrack.style.visibility = 'visible';
}
}
// End -->
</script>
I have this in a page and you can assume all this works. All it does is add
text to a floating div which is just the cursor position of the mouse as it
moves about the page. But now I would like you to look at what happened
through nothing done on my part. In fact I don't know what it is:
<script language="javascript" type="text/javascript">
<!-- Begin
function fnTrackMouse(){
if (!event)
event = window.event;
if (docRef)
oNotice.innerText="Coords: ("+10*((event.clientX+docRef.scrollLeft)/10)+",
"+10*((event.clientY+docRef.scrollTop)/10)+ ")";
document.all.floattrack.style.visibility = "visible";
}
// End -->
</script>
Looks almost exactly the same doesn't it? But it is NOT and in fact the
change leads to an error in the browser. No it is not the use of " in the
second instead of ' as in the first. Something else. Look at the end of
the oNotice.innerText statement. Almost at the very end. You will see what
looks like to have spaces here /10)+ ")";
What I just wrote is as different as night is from day from what really
appears there; looking at the ASP in Notepad What really appears there as
shown in Notepad will not copy here. But what is actually there are two
characters áá. So in fact what were are left with is an invalid Javascript
statement. So this is what it looks like:
oNotice.innerText="Coords: ("+10*((event.clientX+docRef.scrollLeft)/10)+",
"+10*((event.clientY+docRef.scrollTop)/10)+áá")";
in Notepad.
So do you really think a hacker has nothing better to do than this? Or that
I just woke up one day and said, "Hey I think I'll screw up my JavaScripting
and throw this áá in somewhere nice.?"
No. Either FrontPage does this or maybe IIS 5.0. I don't know. But I do
know it happens FrontPage does do stuff like this (Like the Hit Counter
issue above) and since it does I am suscpicous.
There is actually more issues with the second rendition above but it is not
important to list them all nor can I really identify them. I just know if I
retype everything after:
10*((event.clientY+docRef.scrollTop)/10)+ ")";
Then the page is fixed. Just retype it exactly as you see it above except
for the spaces (áá).