---
title: "CAPEC-17: Using Malicious Files"
url: https://radicalnotion.ai/capec/capec-17
type: capec
description: "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."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-17: Using Malicious Files

- **Abstraction:** Standard
- **Status:** Draft
- **Typical severity:** Very High
- **Likelihood of attack:** High
- **CAPEC catalog version:** 3.9

## Description

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.

## Execution flow

### Step 1: Explore

\[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 2: Experiment

\[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 3: Exploit

\[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.

## 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:** 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

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability | Execute Unauthorized Commands | Run Arbitrary Code |
| Integrity | Modify Data | - |
| Confidentiality | Read Data | - |
| Confidentiality, Access Control, Authorization | Gain Privileges | - |

## Mitigations

- 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.

## Example instances

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.

## Related weaknesses (CWE)

- [CWE-59](https://radicalnotion.ai/cwe/cwe-59): Improper Link Resolution Before File Access
- [CWE-270](https://radicalnotion.ai/cwe/cwe-270): Privilege Context Switching Error
- [CWE-272](https://radicalnotion.ai/cwe/cwe-272): Least Privilege Violation
- [CWE-282](https://radicalnotion.ai/cwe/cwe-282): Improper Ownership Management
- [CWE-285](https://radicalnotion.ai/cwe/cwe-285): Improper Authorization
- [CWE-693](https://radicalnotion.ai/cwe/cwe-693): Protection Mechanism Failure
- [CWE-732](https://radicalnotion.ai/cwe/cwe-732): Incorrect Permission Assignment for Critical Resource

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-122](https://radicalnotion.ai/capec/capec-122) | Privilege Abuse |
| Child | [CAPEC-177](https://radicalnotion.ai/capec/capec-177) | Create files with the same name as files protected with a higher classification |
| Child | [CAPEC-263](https://radicalnotion.ai/capec/capec-263) | Force Use of Corrupted Files |
| Child | [CAPEC-562](https://radicalnotion.ai/capec/capec-562) | Modify Shared File |
| Child | [CAPEC-563](https://radicalnotion.ai/capec/capec-563) | Add Malicious File to Shared Webroot |
| Child | [CAPEC-642](https://radicalnotion.ai/capec/capec-642) | Replace Binaries |
| Child | [CAPEC-650](https://radicalnotion.ai/capec/capec-650) | Upload a Web Shell to a Web Server |
| Can precede | [CAPEC-233](https://radicalnotion.ai/capec/capec-233) | Privilege Escalation |
| Related | [CAPEC-1](https://radicalnotion.ai/capec/capec-1) | Accessing Functionality Not Properly Constrained by ACLs |
| Related | [CAPEC-180](https://radicalnotion.ai/capec/capec-180) | Exploiting Incorrectly Configured Access Control Security Levels |

## Taxonomy mappings

| Taxonomy | Entry | Id |
| --- | --- | --- |
| ATTACK | Hijack Execution Flow: Executable Installer File Permissions Weakness | 1574.005 |
| ATTACK | Hijack Execution Flow: Services File Permissions Weakness | 1574.010 |

## Frequently asked questions

### 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), CWE-270 (Privilege Context Switching Error), CWE-272 (Least Privilege Violation) and CWE-282 (Improper Ownership Management).

### How severe is CAPEC-17?

MITRE rates CAPEC-17 as Very High severity with high likelihood of attack.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/17.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-17). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
