词条 | Directory traversal attack |
释义 |
A directory traversal (or path traversal) consists in exploiting insufficient security validation / sanitization of user-supplied input file names, such that characters representing "traverse to parent directory" are passed through to the file APIs. The goal of this attack is to use an affected application to gain unauthorized access to the file system. This attack exploits a lack of security (the software is acting exactly as it is supposed to) as opposed to exploiting a bug in the code. Directory traversal is also known as the ExampleA typical example of vulnerable application in PHP code is: An attack against this system could be to send the following HTTP request: Generating a server response such as: The repeated
Unix However, in more recent Unix systems, the passwd file does not contain the hashed passwords. They are, instead, located in the shadow file which cannot be read by unprivileged users on the machine. It is however, still useful for account enumeration on the machine, as it still displays the user accounts on the system. Variations of directory traversalListed below are some known directory traversal attack strings: Directory traversal on UnixCommon Unix-like directory traversal uses the Sudo, a privilege management program ubiquitous in Unix is vulnerable to this attack when users use the glob wildcard (e.g. Directory traversal on Microsoft WindowsMicrosoft Windows and DOS directory traversal uses the..\\ or ../ character sequences.[1]Each partition has a separate root directory (labeled This kind of attack has been the cause of numerous Microsoft vulnerabilities.[2][3] URI encoded directory traversalCanonicalization problem. Some web applications scan query string for dangerous characters such as:
to prevent directory traversal. However, the query string is usually URI decoded before use. Therefore, these applications are vulnerable to percent encoded directory traversal such as:
Unicode / UTF-8 encoded directory traversalCanonicalization problem. UTF-8 was noted as a source of vulnerabilities and attack vectors by Bruce Schneier and Jeffrey Streifling.[4]When Microsoft added Unicode support to their Web server, a new way of encoding Multiple percent encodings, such as
translated into Percent encodings were decoded into the corresponding 8-bit characters by Microsoft webserver. This has historically been correct behavior as Windows and DOS traditionally used canonical 8-bit characters sets based upon ASCII. However, the original UTF-8 was not canonical, and several strings were now string encodings translatable into the same string. Microsoft performed the anti-traversal checks without UTF-8 canonicalization, and therefore not noticing that (HEX) Zip/archive traversal attacksThe use of archive formats like zip allows for directory traversal attacks: files in the archive can be written such that they overwrite files on the filesystem by backtracking. Code that uncompresses archive files can be written to check that the paths of the files in the archive do not engage in path traversal. Possible methods to prevent directory traversalA possible algorithm for preventing directory traversal would be to:
The user can use the NULL character (indicating the end of the string) in order to bypass everything after the See also
References1. ^{{cite news|url=https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx |title=Naming Files, Paths, and Namespaces |publisher=Microsoft |quote=File I/O functions in the Windows API convert '/' to '\\' as part of converting the name to an NT-style name}} 2. ^{{cite web|url=http://www.securityfocus.com/columnists/285 |title=Security Holes That Run Deep |first=Mark |last=Burnett |date=December 20, 2004 |publisher=SecurityFocus}} 3. ^{{cite web|url=https://www.cvedetails.com/vulnerability-list/vendor_id-26/opdirt-1/Microsoft.html |title=Microsoft: Security Vulnerabilities (Directory Traversal) |publisher=CVE Details}} 4. ^Crypto-Gram Newsletter July 2000 5. ^{{cite web|url=http://lists.sans.org/pipermail/unisog/2002-June/020592.html|title=IIS cmd.exe attack strings}} Resources
External links
2 : Web security exploits|Computer security exploits |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。