Category: 

What is a Directory Traversal?

Article Details
  • Written By: Jessica Susan Reuter
  • Edited By: Allegra J. Lingo
  • Last Modified Date: 24 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Roughly one-fifth of the world's stock of gold - worth over $200 billion USD - is stored under the streets of London.  more...

September 30 ,  1949 :  The Berlin Air Lift ended.  more...

A directory traversal is a process by which the contents of computer folders, or directories, are systematically scanned through. For both developers and novice computer users, a directory traversal can yield a great deal of useful information. This methodology is used in a variety of computer applications, including file searches in an operating system.

When performing a directory traversal, the process begins in the "working directory." Many directory traversals are recursive, meaning that they scan the contents of the working directory as well as the contents of every separate folder, or subdirectory, the working directory contains. Recursive directory traversals can easily identify large groups of files with similar characteristics. A directory traversal may also be used to select specific file types for analysis, modification, or deletion.

Traversals can be done in two different ways. The first traversal method, which is usually performed by all computer users at some point, is done through an operating system's user interface. Precisely how this is done depends on the operating system but in this context, traversing directories is often as simple as clicking into a folder, then clicking into a folder within that folder, and so forth. Since the speed of this approach is limited by how fast a user can manually go through directories, it is usually the slower of the two traversal methods.

Ad

Programmers and developers usually employ the second traversal method, which entails giving explicit commands to the operating system, rather than using its interface. This method is more flexible than interface-based traversal, and can often be linked with other operating system commands to access and modify many files at once. In general, most computer users do not need to do traversals this way, although the option is almost always there.

Though directory traversals can be very useful, they have the potential to be exploited by malicious code, particularly in web pages. When programming web sites, web designers must often take great care to ensure that no unauthorized directory traversals can be done by a client viewing a web page. Since a directory traversal has the potential to showcase a lot of information, allowing a client to access a web page's component directories could pose a significant security risk. Directory traversals are not dangerous or malicious in themselves, so scanning through directories as a trusted user on a computer does not automatically endanger a computer or its data. In almost all contexts, directory traversals are safe, useful methods for getting information from a computer.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}