TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-05-2007, 10:33 PM   #1 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Red face The Perfect Trick for Prying Eyes

Let's face it, without getting all philosophical on the subject, marketing is everywhere these days. It's literally in our faces. In 20 years I wouldn't be surprised if a small flying drone followed us around with a television screen implanted in it, providing custom adverts for us to see, based on our consumerism patterns. This little trick, achieved using Javascript, allows you to essentially build an entire profile on your visitors. You can see which websites they've been to and act accordingly.

I'm confident we're all familiar with the Internet's default blue colour for links, I'm sure it once had a dedicated Wikipedia page but I'm unable to locate it now. I was going to throw some hints like the fact TalkPHP doesn't yet have a Wikipedia page - wink, wink, nudge, nudge, and all that. Even though it seems to have been stripped of its Wikipedia page for one reason or another, it's still perhaps the most popular colour on the Internet these days.

For those of you who I've left far behind with the previous paragraph - this is the famous blue!

...And for those of you who are quite fond of the default blue colour, don't worry, it's not the culprit. However, it is part of the problem in the sense that browsers take-over the colours. The default blue is used for links that have not been visited, whilst links that have been visited turn a nice purple colour by default. Consider the following link:

Code:
<a href="http://www.google.com/">Google.com</a>
If you've visited Google.com before then without any styles applied, this link colour would appear purple to you, whereas it would be blue if you haven't. Using a crafty bit of Javascript we can ascertain whether or not you visited a website by detecting the purple colour. The following code works in Firefox, I have not exerted myself to make it cross-compatible.

PHP Code:
<script type="text/javascript">
    
    var 
pA document.getElementsByTagName('a');
    
    for(
iIndex 0iIndex pA.lengthiIndex++)
    {
        var 
szColor document.defaultView.getComputedStyle(pA[iIndex], null).getPropertyValue('color');
        
        
alert(szColor == 'rgb(85, 26, 139)' 'Visited' 'Not Visited');
    }

</script> 
What the above code does is obtains every single a element from the website, and check whether or not you've visited that page before. If you have then it will pop-up with a message box saying Visited. However, if you've never been to the destination before, it will say Not Visited. Good, eh?

Naturally, there are copious amounts of uses for such a technique. How about these possibilities:
  1. Allow law enforcement bodies to detect if you've been to a website, and in turn a page on that website where you need to be logged in, which is serving illegal content.
  2. Allow marketers to build a comprehensive profile of your surfing habits by using the power of AJAX to log its findings in to a database.
  3. Allow such sites as Digg and Reddit to detect if you've been to a website, such as Subvert and Profit, and accessed a page on there to which you need to be logged in to view.

As you can clearly see from the above list. Each outcome would have its negative downsides. For point 1, you could subsequently be monitored and then arrested. Point 2, your personal surfing habits could be logged and sold on. Point 3, your Digg and/or Reddit account will be banned.

So the next time you think you're invincible on the Internet, think again. If you're extremely paranoid about this little trick being used against you, then the best way to combat it is to instruct your browser not to cache any data, as well as your surfing habits, that way all links will be blue, and remember, a blue link is now a good link! Well, purple was always a very mystic colour anyway!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:29 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design