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
https://forums.phpfreaks.com/topic/104605-page-properties-hacking/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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