CAPEC-252 Metadata
Likelihood of Attack
High
Typical Severity
Medium
Overview
Summary
The attacker loads and executes an arbitrary local PHP file on a target machine. The attacker could use this to try to load old versions of PHP files that have known vulnerabilities, to load PHP files that the attacker placed on the local machine during a prior attack, or to otherwise change the functionality of the targeted application in unexpected ways.
Prerequisites
The targeted PHP application must have a bug that allows an attacker to control which code file is loaded at some juncture.
Execution Flow
Step | Phase | Description | Techniques |
---|---|---|---|
1 | Explore | [Survey application] Using a browser or an automated tool, an adversary follows all public links on a web site. They record all the links they find. The adversary is looking for URLs that show PHP file inclusion is used, which can look something like "http://vulnerable-website/file.php?file=index.php". |
|
2 | Experiment | [Attempt variations on input parameters] Once the adversary finds a vulnerable URL that takes file input, they attempt a variety of path traversal techniques to attempt to get the application to display the contents of a local file, or execute a different PHP file already stored locally on the server. |
|
3 | Exploit | [Include desired local file] Once the adversary has determined which techniques of path traversal successfully work with the vulnerable PHP application, they will target a specific local file to include. These can be files such as "/etc/passwd", "/etc/shadow", or configuration files for the application that might expose sensitive information. |
|
Potential Solutions / Mitigations
No specific solutions listed.
Related Weaknesses (CWE)
CWE ID | Description |
---|---|
CWE-829 | Inclusion of Functionality from Untrusted Control Sphere |
Related CAPECs
CAPEC ID | Description |
---|---|
CAPEC-251 | The attacker forces an application to load arbitrary code files from the local machine. The attacker could use this to try to load old versions of library files that have known vulnerabilities, to load files that the attacker placed on the local machine during a prior attack, or to otherwise change the functionality of the targeted application in unexpected ways. |
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.