Jump to content

Page Properties & Hacking


rarebit

Recommended Posts

Hi, I tend not to use javascript too much, but i'm forcing myself go through the motions and writing myself a tutorial section on the subject.

 

What i've done here is to iterate through all the properties (that I know of) and dump them to screen, however not knowing what most of them are and what potential risk they may pose when it comes to XSS and the such like i'm wondering whether it's a good idea to include the script within my CMS?

 

<script language="Javascript" type="text/javascript">

function display_properties(obj, sobj)
{
document.write(sobj.toUpperCase() + " PROPERTIES<br>=====================<br>");
var property;
var desc;
for (property in obj)
{
	if(property != 'display_properties')
	{
		try
		{
			desc = obj[property];
		}
		catch(e)
		{
			desc = "ERRROR";
		}
		document.write("The " + property + " of " + sobj + " is: " + desc + "<br>")
	}
}
}

var names = new Array('window', 'document', 'location', 'History', 'Frame', 'Link', 'Anchor', 'Image', 'Area', 'Applet', 'Event', 'Form', 'Elements', 'Text', 'Textarea', 'Checkbox', 'Submit', 'Reset', 'Select', 'Option', 'Password', 'Hidden', 'FileUpload', 'Navigator', 'Screen', 'Embed', 'MimeType', 'Plugin');
var property;
for (property in names)
{
document.write("<br><br><br>");
try
{
	obj = eval(names[property]);
	display_properties(obj, names[property]);
}
catch(e)
{
	document.write(names[property].toUpperCase() + " PROPERTIES<br>=====================<br>UNDEFINED<br>");
}
}
</script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.