Detect Proc Memory in IBM QRadar
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/
QRadar Detection Query
SELECT DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time, sourceip AS host_ip, username, "Message" AS raw_message, LOGSOURCETYPENAME(devicetype) AS log_source_type, QIDNAME(qid) AS event_name FROM events WHERE (LOGSOURCETYPENAME(devicetype) ILIKE '%Linux%' OR LOGSOURCETYPENAME(devicetype) ILIKE '%audit%') AND ("Message" ILIKE '%/proc/%/mem%' OR "Message" ILIKE '%/proc/%/maps%' OR "Message" ILIKE '%/proc/%/syscall%') AND "Message" NOT ILIKE '%/proc/self/%' AND "Message" NOT ILIKE '%exe="/usr/bin/gdb"%' AND "Message" NOT ILIKE '%exe="/usr/bin/strace"%' AND "Message" NOT ILIKE '%exe="/usr/bin/ltrace"%' AND "Message" NOT ILIKE '%exe="/usr/bin/perf"%' AND "Message" NOT ILIKE '%exe="/bin/ps"%' AND "Message" NOT ILIKE '%exe="/usr/bin/top"%' ORDER BY starttime DESC LAST 24 HOURS AQL query against Linux audit log events ingested into QRadar. Identifies reads and writes to /proc/[pid]/mem and /proc/[pid]/maps which are the primary file paths leveraged in proc memory injection attacks. Filters out known-good debugger and monitoring executables by matching against the exe= field in auditd messages.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate kernel profiling sessions using 'perf record' that enumerate process memory maps for symbol resolution
- Java or JVM-based applications that inspect /proc/self/maps during JIT compilation and heap introspection — note /proc/self is excluded but some JVMs use numeric PIDs
- Automated vulnerability scanners (OpenVAS, Nessus agent) running as root that read /proc filesystem entries during host enumeration
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.