CAPEC-17: Using Malicious Files
An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
Last updated
Overview
CAPEC-17 (Using Malicious Files) is a standard-level attack pattern catalogued by MITRE in the Common Attack Pattern Enumeration and Classification (CAPEC). It describes a recurring method attackers use to exploit software weaknesses.
How the attack works
The phases an attacker typically follows to carry out this attack.
- Step 1Explore
[Determine File/Directory Configuration] The adversary looks for misconfigured files or directories on a system that might give executable access to an overly broad group of users.
- Through shell access to a system, use the command "ls -l" to view permissions for files and directories.
- Step 2Experiment
[Upload Malicious Files] If the adversary discovers a directory that has executable permissions, they will attempt to upload a malicious file to execute.
- Upload a malicious file through a misconfigured FTP server.
- Step 3Exploit
[Execute Malicious File] The adversary either executes the uploaded malicious file, or executes an existing file that has been misconfigured to allow executable access to the adversary.
What the attacker needs
Prerequisites
- System's configuration must allow an attacker to directly access executable files or upload files to execute. This means that any access control system that is supposed to mediate communications between the subject and the object is set incorrectly or assumes a benign environment.
Skills required
- Low skill: To identify and execute against an over-privileged system interface
Resources required
- Ability to communicate synchronously or asynchronously with server that publishes an over-privileged directory, program, or interface. Optionally, ability to capture output directly through synchronous communication or other method such as FTP.
Consequences
What a successful CAPEC-17 attack can achieve.
Execute Unauthorized Commands
Affects: Confidentiality, Integrity, Availability
Run Arbitrary Code
Modify Data
Affects: Integrity
Read Data
Affects: Confidentiality
Gain Privileges
Affects: Confidentiality, Access Control, Authorization
How to mitigate it
Defenses that reduce the risk of CAPEC-17.
- Design: Enforce principle of least privilege
- Design: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands.
- Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables.
Examples
Consider a directory on a web server with the following permissions drwxrwxrwx 5 admin public 170 Nov 17 01:08 webroot This could allow an attacker to both execute and upload and execute programs' on the web server. This one vulnerability can be exploited by a threat to probe the system and identify additional vulnerabilities to exploit.
Terminology & mappings
Mapped taxonomies
- ATTACK: Hijack Execution Flow: Executable Installer File Permissions Weakness (1574.005)
- ATTACK: Hijack Execution Flow: Services File Permissions Weakness (1574.010)
Frequently asked questions
Common questions about CAPEC-17.
- What is CAPEC-17?
- An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
- How does a Using Malicious Files attack work?
- It typically unfolds over 3 phases. It begins with: [Determine File/Directory Configuration] The adversary looks for misconfigured files or directories on a system that might give executable access to an overly broad group of users.
- How do you prevent CAPEC-17?
- Design: Enforce principle of least privilege
- What weaknesses does CAPEC-17 target?
- CAPEC-17 exploits 7 CWE weaknesses, including CWE-59 (Improper Link Resolution Before File Access ('Link Following')), CWE-270 (Privilege Context Switching Error), CWE-272 (Least Privilege Violation), CWE-282 (Improper Ownership Management).
- How severe is CAPEC-17?
- MITRE rates CAPEC-17 as Very High severity with high likelihood of attack.
References
Attack-pattern data is sourced from the MITRE CAPEC catalog (v3.9). Weakness associations link to the corresponding CWE entries on RadicalNotion.AI.
Defend against CAPEC-17
Track the CVEs and weaknesses attackers exploit with this technique, with AI-written analysis and remediation guidance.