CAPEC-127: Directory Indexing
Description
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.
- Likelihood of attack
- High
- Typical severity
- Medium
- Abstraction
- DetailedA low-level, detailed pattern, often for a particular technology.
Mechanism of attack: Collect and Analyze Information
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.
Skills required
- LowTo issue the request to URL without given a specific file name
- HighTo bypass the access control of the directory of listings
Consequences
- Confidentiality
Read Data
Information Leakage
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-276Incorrect Default Permissions
- CWE-285Improper Authorization
- CWE-288Authentication Bypass Using an Alternate Path or Channel
- CWE-424Improper Protection of Alternate Path
- CWE-425Direct Request ('Forced Browsing')
- CWE-693Protection Mechanism Failure
- CWE-732Incorrect Permission Assignment for Critical Resource
ATT&CK techniques (CAPEC taxonomy mapping)
Across MITRE's defensive frameworks
Linked through the 1 ATT&CK technique above.
Counter with D3FEND
Defensive techniques MITRE D3FEND maps to the same ATT&CK techniques.
- D3-CFContent Filtering1 shared
- D3-CMContent Modification1 shared
- D3-DFDecoy File1 shared
- D3-FAFile Analysis1 shared
- D3-FEFile Encryption1 shared
- D3-FEVFile Eviction1 shared
- D3-FIMFile Integrity Monitoring1 shared
- D3-LFPLocal File Permissions1 shared
- D3-RFAMRemote File Access Mediation1 shared
- D3-RFRestore File1 shared
- D3-CQContent Quarantine1 shared