AN0579
Analytic 0579
Linux
Detects ptrace-based process injection by correlating audit logs of ptrace syscalls, memory modifications (e.g., poketext, pokedata), and suspicious register manipulation on a target process not normally debugged by the originator. Alerts on processes attempting to ptrace non-child or privileged processes, especially those followed by abnormal memory or execution behavior.
auditd:SYSCALL
mmap, ptrace, process_vm_writev or direct memory ops
auditd:SYSCALL
execve
linux:osquery
state=attached/debugged
[TargetProcessNameFilter]
List of sensitive or rarely-debugged processes (e.g., sshd, systemd, container daemons) to alert on if ptraced
[TimeWindowBetweenPtraceAndMemoryWrite]
Threshold time (e.g., <10 seconds) between ptrace attach and pokedata syscall
[UserContextMismatch]
Flag when UID of tracer differs from UID of target process (e.g., privilege escalation or container breakout)
[ProcessRelationshipConstraint]
Allowlist relationships (e.g., parent-child) under which ptrace is considered benign