---
name: cyberstrikeus/T1055.009_proc-memory
source: https://app.decimal.ai/s/cyberstrikeus-t1055-009-proc-memory@1/SKILL.md
source_sha256: f528335ea08a
---

# T1055.009 Proc Memory

> **Sub-technique of:** T1055

## High-Level Description

Adversaries may inject malicious code into processes via the /proc filesystem in order to evade process-based defenses as well as possibly elevate privileges. Proc memory injection is a method of executing arbitrary code in the address space of a separate live process.

Proc memory injection involves enumerating the memory of a process via the /proc filesystem (<code>/proc/[pid]</code>) then crafting a return-oriented programming (ROP) payload with available gadgets/instructions. Each running process has its own directory, which includes memory mappings. Proc memory injection is commonly performed by overwriting the target processes’ stack using memory mappings provided by the /proc filesystem. This information can be used to enumerate offsets (including the stack) and gadgets (or instructions within the program that can be used to build a malicious payload) otherwise hidden by process memory protections such as address space layout randomization (ASLR). Once enumerated, the target processes’ memory map within <code>/proc/[pid]/maps</code> can be overwritten using dd.

Other techniques such as Dynamic Linker Hijacking may be used to populate a target process with more available gadgets. Similar to Process Hollowing, proc memory injection may target child processes (such as a backgrounded copy of sleep).

Running code in the context of another process may allow access to the process's memory, system/network resources, and possibly elevated privileges. Execution via proc memory injection may also evade detection from security products since the execution is masked under a legitimate process.

## Kill Chain Phase

- Defense Evasion (TA0005)
- Privilege Escalation (TA0004)

**Platforms:** Linux

## What to Check

- [ ] Identify if Proc Memory technique is applicable to target environment
- [ ] Check Linux systems for indicators of Proc Memory
- [ ] Verify mitigations are bypassed or absent (2 known mitigations)
- [ ] Assess detection coverage (1 detection strategies)

## How to Test

### Manual Testing

1. **Identify Attack Surface**: Determine if the target environment is susceptible to Proc Memory by examining the target platforms (Linux).

2. **Assess Existing Defenses**: Review whether mitigations for T1055.009 are in place. If defenses are absent or misconfigured, this technique may be exploitable.

3. **Execute Test**: Use tools and methods described in the MITRE ATT&CK page and external references below.

> **Note**: No Atomic Red Team tests available for this technique. See [Atomic Red Team GitHub](https://github.com/redcanaryco/atomic-red-team) for updates.

## Remediation Guide

### M1040 Behavior Prevention on Endpoint

Some endpoint security solutions can be configured to block some types of process injection based on common sequences of behavior that occur during the injection process.

### M1022 Restrict File and Directory Permissions

Restrict the permissions on sensitive files such as <code>/proc/[pid]/maps</code> or <code>/proc/[pid]/mem</code>.

## Detection

### Detection Strategy for /proc Memory Injection on Linux

## Risk Assessment

| Finding                          | Severity | Impact          |
| -------------------------------- | -------- | --------------- |
| Proc Memory technique applicable | High     | Defense Evasion |

## CWE Categories

| CWE ID  | Title                        |
| ------- | ---------------------------- |
| CWE-693 | Protection Mechanism Failure |

## References

- [Uninformed Needle](http://hick.org/code/skape/papers/needle.txt)
- [GDS Linux Injection](https://blog.gdssecurity.com/labs/2017/9/5/linux-based-inter-process-code-injection-without-ptrace2.html)
- [DD Man](http://man7.org/linux/man-pages/man1/dd.1.html)
- [Atomic Red Team - T1055.009](https://github.com/redcanaryco/atomic-red-team/tree/master/atomics/T1055.009)
- [MITRE ATT&CK - T1055.009](https://attack.mitre.org/techniques/T1055/009)