Search Perform an advanced search query SOFTPEDIA
 
SOFTPEDIA
Updated one minute ago
HomeSubmit a program for being reviewedAdvertise on our websiteGet help on surfing our websitesSend us your feedbackGet information about our XML/RSS backend and how to use itBrowse the news archiveVisit our discussion forumVizitati forumul in limba romana



KLIP
  1. HOME
  2. SCIENCE
  3. TECHNOLOGY
  4. WEBMASTER
  5. SECURITY
  6. MICROSOFT
  7. LINUX
  8. APPLE
  9. GAMES
  10. TELECOMS
  11. REVIEWS
  12. LIFE & STYLE
  13. EDITORIALS
  14. INTERVIEWS
  15. RSS
Welcome!
Hello, Guest

Login if you have a Softpedia.com account.

Otherwise, register for one.

TIPS AND TRICKS

An Unwanted Trip To A Porn Website ?

- Demonstration of Websites Visitors Redirection with External Javascripts

By: Catalin Bocanu, Web News Editor

There are situations when you call a certain web address in your web browser, but instead you could be redirected to a website having porn content or other type of content. This was the unfortunate
case of perl.com website, which was redirected for a short period of time to a porn website, due to the presence of a remotely-included Javascript in their webpages HTML code.

O'Reilly Radar stated: "One of our advertisers was using an ads system that required our pages to load Javascript from their site. It only took three things to turn perl.com into porn.com: (1) the advertiser's domain lapsed, (2) the porn company bought it, (3) they replaced the Javascript that we were loading with a small chunk that redirected to the porn site (note that nothing on or about perl.com changed)." They initially thought that the perl.com website was hacked, because the respective Javascript does not indicate website security leak, due to the known provenance. Their unpleasant experience should always remember us about the insecurities induced by the external Javascripts, widgets or any other type of included code that will be executed on client side.

It is very simple to demonstrate how can a website address, domain or subdomain name be redirected to another one through an external Javascript. Lets consider the next two codes listings, which must be saved as redirection.js:

CODE
window.location="http://webscripts.softpedia.com"
alert ("You will be redirected to SOFTPEDIA WEBSCRIPTS SECTION")


respectively index.html:

CODE
<html>
<head>
<title>Javascript Redirection Example</title>
<script src="redirection.js"></script>
</head>
<body>
This is an example of redirection Javascript.
</body>
</html>


The fourth line from the index.html file (in the second code listing) will load the external Javascript called redirection.js determining the index.html page visitor to be redirected to the web address http://webscripts.softpedia.com. The redirection.js Javascript can be included anywhere in the HTML code. In the presented case, it is assumed that the redirection.js is in the same folder with index.html.

Now we will demonstrate the loading of the redirection.js Javascript from a certain web address. If this Javascript is situated on a webserver, at the address http://domainname.com/redirection.js, then the fourth line in the index.html file will become

CODE
<script src="http://domainname.com/redirection.js"></script>


This is only a simple example of Javascript redirection. It is useful when you define your own Javascript redirection codes. But in case of external Javascript from third party websites, you could always have unpleasant surprises if an ad or widget code is changed. Beside domain redirection with Javascript, other malicious actions could be conducted as long as the respective client side code can be executed through your web pages calls. In conclusion, you must always trust the source code provided by your advertisers and eventually look at the content and code structure in order to determine its actions, especially in case of client side code when known security leaks may exist.



MORE RELATED ARTICLES: The Basic Structure of a HTML Template Client-Side Programming HTML Purifier Web Site Development with WYSIWYG HTML Editors Easy Building of Web Applications with HTML/OS Trip into the Future of HTML Windows Media Player in HTML Google Page Creator A Simple Javascript Example Free Translation of Web Pages
 
Comments | Link here | Subscribe
Print | Send to friend
Today's News | Yesterday's News

Search:


21st January 2008, 17:01 GMT | Copyright (c) 2008 Softpedia | Contact:
Read by 1,710 user(s) | Rating: | 7 vote(s) so far | Cast your vote:
An Unwanted Trip To A Porn Website ? - USER OPINIONS




We are sorry, there are no opinions available for this article.






SHARE YOUR OPINION ABOUT An Unwanted Trip To A Porn Website ?

Since you are not logged on, your comments will have to be approved before being displayed.
Click here to login, or register.
Your Name:
Your Email:
Type in the result:
Your Opinion:
 


DO YOU WANT TO CONTACT US?  

If you have some comments or you want to send us some information you can send us an email directly to .
You can use the form below for the same purpose.
Your full name: (at least 3 characters)
Your email address: (at least 5 characters)
Message subject: (at least 5 characters)
Message text:
(at least 10 characters)
Type in the result:
 
 



© 2001 - 2008 Softpedia. All rights reserved.
Softpedia™ and Softpedia™ logo are registered trademarks of SoftNews NET SRL.
Copyright Information | Privacy Policy | Terms of Use | Contact Softpedia | Update your software | Archive