Ahot's weblog

Friday Sep 05, 2008

You have to know what information can be accessed with JavaScript. You have to understand that all such information can be easily uploaded to web-server. All such information is harmless. However you can think differently. I will show you what javascript can take from you. And you will decide how is it terrible for you.

Let me show you live example (it doesn't work without JavaScript enabled):
window.screen - information about your screen-resolution and color-depth
window.navigator - your browser name, cpu type, operation system
window.navigator.plugins - some information about your plugins installed
window.document - your current URL, URL where you come here from
window.document.cookie - cookies for current domain
Source of JavaScript program here:
<script>
document.write("<br><b>window.screen</b><br>");
document.write("window.screen.height = " +  window.screen.height + "<br>");
document.write("window.screen.width = " +  window.screen.width + "<br>");
document.write("window.screen.pixelDepth  = " +  window.screen.pixelDepth  + "<br>");
document.write("window.screen.colorDepth  = " +  window.screen.colorDepth  + "<br>");
 
document.write("<br><b>window.navigator</b><br>");
for (var key in window.navigator) {
	if (typeof(window.navigator[key]) == "function") continue;
	if (typeof(window.navigator[key]) == "object") continue;
	document.write("window.navigator."+key+" = "+ window.navigator[key] +"<br>");
}
document.write("<br><b>window.navigator.plugins</b><br>");
for (var key in window.navigator.plugins) {
	if (typeof(window.navigator.plugins[key]) == "function") continue;
	document.write("window.navigator.plugins."+key+" = "+ window.navigator.plugins[key].name +" : " +window.navigator.plugins[key].filename +"<br>");
}

document.write("<br><b>window.document</b><br>");
document.write("document.referrer: "+document.referrer +"<br>");
document.write("document.URL: "+document.URL +"<br>");

document.write("<br><b>window.document.cookie</b><br>");
if (document.cookie == "") document.write("No cookies<br>");
document.write(document.cookie.toString().replace(/;/g, "<br>"));

</script>
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

FEEDS:

BOOKMARKS:

This blog copyright 2009 by ahot