Detect Proc Memory in Google Chronicle
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 involves enumerating the memory of a process via the /proc filesystem (/proc/[pid]) 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 otherwise hidden by ASLR. Once enumerated, the target processes' memory map within /proc/[pid]/maps can be overwritten using dd.
MITRE ATT&CK
- Technique
- T1055 Process Injection
- Sub-technique
- T1055.009 Proc Memory
- Canonical reference
- https://attack.mitre.org/techniques/T1055/009/
YARA-L Detection Query
rule proc_memory_injection_t1055_009 {
meta:
author = "df00tech"
description = "Detects /proc/pid/mem and /proc/pid/maps file access indicative of proc memory injection (T1055.009). Adversaries enumerate memory layout via maps and overwrite stack or heap via direct mem writes."
mitre_attack_tactic = "Defense Evasion, Privilege Escalation"
mitre_attack_technique = "T1055.009"
severity = "HIGH"
confidence = "MEDIUM"
created = "2026-04-16"
events:
$e.metadata.event_type = "FILE_OPEN"
$e.target.file.full_path = /\/proc\/[0-9]+\/(mem|maps|syscall)/
not $e.target.file.full_path = /\/proc\/self\//
not re.regex($e.principal.process.file.full_path, `/(gdb|strace|ltrace|perf|systemd|dockerd|containerd|ps|top|htop|lsof)$`)
condition:
$e
} Chronicle YARA-L 2.0 rule using UDM (Unified Data Model) fields to detect file open events targeting /proc/[pid]/mem, /proc/[pid]/maps, or /proc/[pid]/syscall paths. Excludes access to /proc/self/ (legitimate) and known debugger or system monitoring executables. Triggers on individual file open events for immediate alerting without requiring sequences.
Data Sources
Required Tables
False Positives & Tuning
- Language runtimes such as Go or Rust that read /proc/[pid]/maps at startup to initialize memory-safe stack bounds checking
- Monitoring daemons like collectd or netdata that poll /proc entries for system metrics and occasionally access process-specific memory mappings
- Container escape detection tools (e.g. Falco in detection mode) that themselves access /proc/pid paths to identify anomalous container activity
Other platforms for T1055.009
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Read Target Process Memory Maps
Expected signal: auditd: open() syscall on /proc/<pid>/maps with the calling process (shell) details. The maps output shows memory regions including stack address needed for injection.
- Test 2DD-based /proc/pid/mem Write Simulation
Expected signal: auditd: open() on /proc/<pid>/maps. In a real injection: write() syscall to /proc/<pid>/mem would be logged. The dd command itself generates process creation events.
- Test 3Check /proc Hardening Configuration
Expected signal: No security telemetry — this is a configuration check. The output shows current hardening level.
References (5)
- https://attack.mitre.org/techniques/T1055/009/
- http://hick.org/code/skape/papers/needle.txt
- https://blog.gdssecurity.com/labs/2017/9/5/linux-based-inter-process-code-injection-without-ptrace2.html
- http://man7.org/linux/man-pages/man1/dd.1.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1055.009/T1055.009.md
Unlock Pro Content
Get the full detection package for T1055.009 including response playbook, investigation guide, and atomic red team tests.