Being safe on the internet (was Re: Here we go again - ISP DPI, but is it interception?)

Adrian Hayter adrianhayter at
Wed Aug 4 13:01:20 BST 2010

>> Consider that the url pointed to
>> the location /var/www/ on a server.
>> Doing a directory traversal on the url (such as:
>> ) would (on some insecure
>> servers) get the location /var/www/ Now we know from the
>> previous location that the directory 'public' is contained here, but
>> so could some other directories, such as 'logs' or even important
>> private information.
>> As you can see, this would matter to the host, since a lot of
>> webservers are configured to display the contents of directories when
>> they do not come across a specified index file (such as index.html or
>> index.php). If you have a folder that is meant to be publicly
>> accessible, you do not want people to be able to traverse out of that
>> directory and into one that contains private data.
> Most helpful - thank you.
> Taking the above example, could you explain the difference in effect
> between and
> <>?  Do they not
> lead to the same location on the server, namely /var/www/
> Nicholas
> -- 
> Contact and PGP key here <>

Since ../ means "go up one directory in the tree", it is perhaps simpler to imagine that you are at the url and are applying these ../ 'commands' one by one. So we are at the url, and we are going to apply ../ three times. Currently we are in the directory 'morestuff', and so applying the first ../ will take up up one directory to 'stuff'. The second ../ will take us up another level to the root directory of The third ../ will then take us up a further directory, but this can't be represented as a url, because we are going above the url root as it were, and into the realm of the actual filesystem itself.

If the url points to /var/www/, then the following is true (assuming the webserver is set up in a simple manner): => /var/www/ => /var/www/ => /var/www/ => /var/www/

So whilst points to the same thing as, three directory traversals will go up even further.

On most webservers I've come across, there are systems in place to prevent this, and it doesn't matter how many times you add an extra ../, the furthest you can traverse is to the root of the actual URL (i.e. As a matter of interest, I applied this to my own website, and if you visit this link: you should get the homepage (i.e. Adding extra ../ doesn't change this behaviour.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ukcrypto mailing list