LoFP LoFP / some applications may intentionally replace their executable image after performing setup or initialization. review the executable transition, elapsed time, parent process, host role, and related activity; tune the filter macro for expected workloads.

Techniques

Sample rules

Linux Auditd Process Image Change Under Same PID

Description

This analytic detects a successful Linux execve event where a PID changes executable image under the same parent after the prior image has been active for at least one second and no more than 60 seconds. A delayed image change in an existing process can indicate execution following exploitation and should be investigated with related endpoint and network activity.

Detection logic

`linux_auditd`
type=SYSCALL
success="yes"
(
    syscall IN ("59", "221", "11")
    OR
    SYSCALL="execve"
)


| sort 0 _time


| streamstats current=f window=1 global=f last(exe) as previous_exe last(_time) as previous_time last(ppid) as previous_ppid by host pid


| eval transition_seconds=round(_time - previous_time, 3)


| where isnotnull(previous_exe) AND previous_exe!=exe AND ppid=previous_ppid AND transition_seconds>=1 AND transition_seconds<=60


| stats count as transition_count
        min(previous_time) as firstTime
        max(_time) as lastTime
        values(comm) as process_name
        values(uid) as uid
        values(auid) as auid
        values(subj) as subj
  by host pid ppid previous_exe exe


| rename host as dest exe as current_exe


| `security_content_ctime(firstTime)`

| `security_content_ctime(lastTime)`

| `linux_auditd_process_image_change_under_same_pid_filter`