T1055.008 Google Chronicle · YARA-L

Detect Ptrace System Calls in Google Chronicle

Adversaries may inject malicious code into processes via ptrace (process trace) system calls in order to evade process-based defenses as well as possibly elevate privileges. Ptrace system call injection involves attaching to and modifying a running process. The ptrace system call enables a debugging process to observe and control another process (and each individual thread), including changing memory and register values. Ptrace system call injection is commonly performed by writing arbitrary code into a running process (ex: malloc) then invoking that memory with PTRACE_SETREGS to set the register containing the next instruction to execute. Ptrace system call injection can also be done with PTRACE_POKETEXT/PTRACE_POKEDATA, which copy data to a specific address in the target processes' memory.

MITRE ATT&CK

Tactic
Defense Evasion Privilege Escalation
Technique
T1055 Process Injection
Sub-technique
T1055.008 Ptrace System Calls
Canonical reference
https://attack.mitre.org/techniques/T1055/008/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule linux_ptrace_injection_t1055_008 {
  meta:
    author = "Detection Engineering"
    description = "Detects ptrace syscalls with write or attach capability on Linux endpoints indicating process injection - T1055.008"
    mitre_attack_technique = "T1055.008"
    mitre_attack_tactic = "Defense Evasion, Privilege Escalation"
    severity = "HIGH"
    confidence = "MEDIUM"
    reference = "https://attack.mitre.org/techniques/T1055/008/"

  events:
    // Chronicle normalizes Linux auditd PTRACE_ATTACH and PTRACE_SEIZE events
    // to PROCESS_OPEN in UDM when the Linux forwarder parses auditd SYSCALL records
    $e.metadata.event_type = "PROCESS_OPEN"
    $e.principal.process.pid > 0
    $e.target.process.pid > 0
    $e.principal.process.pid != $e.target.process.pid
    $e.principal.asset.platform_software.platform = "LINUX"
    $e.principal.process.file.full_path != ""
    not re.regex(
      $e.principal.process.file.full_path,
      `/(gdb|strace|ltrace|valgrind|perf|dockerd|containerd|runc|lldb|py-spy|rbspy)$`
    )

  condition:
    $e
}
high severity medium confidence

Chronicle YARA-L 2.0 rule detecting ptrace-based process injection on Linux by matching PROCESS_OPEN UDM events where a non-debugger principal process opens or attaches to a distinct target process. Chronicle's Linux auditd parser normalizes PTRACE_ATTACH and PTRACE_SEIZE syscall records from auditd SYSCALL type events into PROCESS_OPEN UDM event type, populating principal.process (attacker) and target.process (victim) fields. Name-based exclusions filter known legitimate debuggers via regex on the full executable path.

Data Sources

Chronicle SIEM with Linux auditd log ingestion via Chronicle ForwarderChronicle UDM log type LINUX_SYSLOG or LINUX_AUDITD with auditd SYSCALL record parsingChronicle with Google Cloud ops agent forwarding Linux audit events

Required Tables

UDM Events (event_type = PROCESS_OPEN from Linux endpoints)

False Positives & Tuning

  • Legitimate profiling tools (e.g., py-spy, rbspy, async-profiler) that attach to running processes for performance analysis and are installed under unexpected paths
  • Service mesh sidecar or observability agents (e.g., eBPF-based tools with ptrace fallback) performing process enumeration or metric collection
  • Kubernetes ephemeral debug containers or kubectl debug sessions that invoke ptrace-based attach operations against pods on the same node
Download portable Sigma rule (.yml)

Other platforms for T1055.008


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.

  1. Test 1Ptrace Attachment via strace

    Expected signal: auditd: SYSCALL type with syscall=101, a0=16 (PTRACE_ATTACH), a1=<target_pid>, exe=/usr/bin/strace. /proc/<target_pid>/status will show TracerPid=<strace_pid> while attached.

  2. Test 2Ptrace Memory Read via /proc/pid/mem

    Expected signal: auditd: open() syscall on /proc/<pid>/maps. If ptrace is used: SYSCALL with syscall=101. The /proc/pid/maps read itself may be logged by auditd file access rules.

  3. Test 3Check ptrace_scope Kernel Setting

    Expected signal: No security telemetry — this is a configuration check. The output shows the current ptrace restriction level.

Unlock Pro Content

Get the full detection package for T1055.008 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections