CAPEC-127: Directory Indexing

Directory Indexing

状态:Draft

Typical_Severify: Medium

攻击可能性:High

描述

An adversary crafts a request to a target that results in the target listing/indexing the content of a directory as output. One common method of triggering directory contents as output is to construct a request containing a path that terminates in a directory name rather than a file name since many applications are configured to provide a list of the directory's contents when such a request is received. An adversary can use this to explore the directory tree on a target as well as learn the names of files. This can often end up revealing test files, backup files, temporary files, hidden files, configuration files, user accounts, script contents, as well as naming conventions, all of which can be used by an attacker to mount additional attacks.

相关攻击模式

ChildOf: CAPEC-54 |Query System for Information

Execution Flow Attack Setp

Setp 1 Explore

[Directory Discovery] Use a method, either manual, scripted, or automated to discover the directories on the server by making requests for directories that may possibly exist. During this phase the adversary is less concerned with whether a directory can be accessed or indexed and more focused on simply discovering what directories do exist on the target.

Setp 2 Experiment

[Iteratively explore directory/file structures] The adversary attempts to access the discovered directories that allow access and may attempt to bypass server or application level ACLs by using manual or automated methods

Setp 3 Exploit

[Read directories or files which are not intended for public viewing.] The adversary attempts to access the discovered directories that allow access and may attempt to bypass server or application level ACLs by using manual or automated methods

前置条件

The target must be misconfigured to return a list of a directory's content when it receives a request that ends in a directory name rather than a file name.

The adversary must be able to control the path that is requested of the target.

The administrator must have failed to properly configure an ACL or has associated an overly permissive ACL with a particular directory.

The server version or patch level must not inherently prevent known directory listing attacks from working.

所需技能

Level Low

To issue the request to URL without given a specific file name

Level High

To bypass the access control of the directory of listings

所需资源

Ability to send HTTP requests to a web application.

后果

Scope Impact Likelihood
C o n f i d e n t i a l i t y Read Data

缓解措施

  1. Using blank index.html: putting blank index.html simply prevent directory listings from displaying to site visitors.

  2. Preventing with .htaccess in Apache web server: In .htaccess, write "Options-indexes".

  3. Suppressing error messages: using error 403 "Forbidden" message exactly like error 404 "Not Found" message.

实例

The adversary uses directory listing to view sensitive files in the application. This is an example of accessing the backup file. The attack issues a request for http://www.example.com/admin/ and receives the following dynamic directory indexing content in the response: Index of /admin Name Last Modified Size Description backup/ 31-May-2007 08:18 - Apache/ 2.0.55 Server at www.example.com Port 80

The target application does not have direct hyperlink to the "backup" directory in the normal html webpage, however the attacker has learned of this directory due to indexing the content. The client then requests the backup directory URL and receives output which has a "db_dump.php" file in it. This sensitive data should not be disclosed publicly.

相关CWE

424 | 对候选路径的不恰当保护

425 | 直接请求(强制性浏览)

288 | 使用候选路径或通道进行的认证绕过

285 | 授权机制不恰当

732 | 关键资源的不正确权限授予

276 | 缺省权限不正确

693 | 保护机制失效

721 | OWASP Top Ten 2007 A10目录 - 未能限制URL访问

内容历史记录

提交

2014-06-23 | CAPEC Content Team | The MITRE Corporation

修改

2015-11-09 | CAPEC Content Team | The MITRE Corporation

Updated References, Related_Attack_Patterns

2017-08-04 | CAPEC Content Team | The MITRE Corporation

Updated Examples-Instances, Related_Vulnerabilities

2018-07-31 | CAPEC Content Team | The MITRE Corporation

Updated References