Welcome to My Blog

Have Informasi then you will control the world entirely. Use Teknology as the weapon to get Information. Greetings the success...


Yudhie17

BLOG DETIK

Minggu, 23 November 2008

How to prevent a webpage 'breaking out of a frame' on a traffic exchange

Traffic exchanges are where two sites link to each other, or where people agree to browse other people's websites, in exchange to traffic to theirs. The problem with setting up a traffic exchange is that each site must be scanned thoroughly to make sure that the content is legal, virus & spyware free, and free of annoying JavaScript. Due to the way JavaScript is set up, it's not possible for the traffic exchange network to disable popups, or override any JavaScript commands.

The only practical way to keep the sites from breaking out of the frames, or creating popups is with periodic server side scanning. You set up a script that downloads the main HTML file, and all linked JavaScript Files from the site in question. It then scans all JavaScript files for commands such as window.open or window.location. If these commands are found, then the site should be flagged as "bad" or "questionable", and someone will have to test it manually before it can be allowed in the traffic exchange.

Another snafu with all of this is that some crafty web developers will serve up "clean" content to the checking script, but return other content to regular browsers. There are several methods to circumvent this technique. First, your script must pretend to be a real browser. The User-Agent must be set to IE or another browser. Additionally, you may consider having your script make the request via a proxy server, so the site won't know what IP address the request will be coming from/ Lastly, you should periodically re-check all the sites in the traffic exchange to make sure the content hasn't changed.

This is one of those "moving target" type of problems, but if you're on top of it, and periodically check the sites manually, you can have a traffic exchange network that is safe and reliable.

Tidak ada komentar: