CAPEC-127 Metadata
Likelihood of Attack
High
Typical Severity
Medium
Overview
Summary
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.
Prerequisites
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.
Execution Flow
Step | Phase | Description | Techniques |
---|---|---|---|
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. |
|
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 |
|
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 |
|
Potential Solutions / Mitigations
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.
Related Weaknesses (CWE)
CWE ID | Description |
---|---|
CWE-276 | Incorrect Default Permissions |
CWE-285 | Improper Authorization |
CWE-288 | Authentication Bypass Using an Alternate Path or Channel |
CWE-424 | Improper Protection of Alternate Path |
CWE-425 | Direct Request ('Forced Browsing') |
CWE-693 | Protection Mechanism Failure |
CWE-732 | Incorrect Permission Assignment for Critical Resource |
Related CAPECs
CAPEC ID | Description |
---|---|
CAPEC-54 | An adversary, aware of an application's location (and possibly authorized to use the application), probes an application's structure and evaluates its robustness by submitting requests and examining responses. Often, this is accomplished by sending variants of expected queries in the hope that these modified queries might return information beyond what the expected set of queries would provide. |
Taxonomy Mappings
Taxonomy: ATTACK
Entry ID | Entry Name |
---|---|
1083 | File and Directory Discovery |
Stay Ahead of Attack Patterns
Understanding CAPEC patterns helps security professionals anticipate and thwart potential attacks. Leverage these insights to enhance threat modeling, strengthen your software development lifecycle, and train your security teams effectively.