You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Transient units created via systemd-run often land here
277
+
find /run/systemd/transient -maxdepth 2 -type f -ls 2>/dev/null
278
+
279
+
# Pull execution history for a suspicious unit
280
+
journalctl -u <name>.service
281
+
journalctl _SYSTEMD_UNIT=<name>.service
282
+
```
283
+
284
+
Transient units are easy to miss because `/run/systemd/transient/` is **non-persistent**. If you are collecting a live image, grab it before shutdown.
285
+
262
286
### Kernel Modules
263
287
264
288
Linux kernel modules, often utilized by malware as rootkit components, are loaded at system boot. The directories and files critical for these modules include:
@@ -298,6 +322,58 @@ Linux systems track user activities and system events through various log files.
298
322
> [!TIP]
299
323
> Linux system logs and audit subsystems may be disabled or deleted in an intrusion or malware incident. Because logs on Linux systems generally contain some of the most useful information about malicious activities, intruders routinely delete them. Therefore, when examining available log files, it is important to look for gaps or out of order entries that might be an indication of deletion or tampering.
300
324
325
+
### Journald triage (`journalctl`)
326
+
327
+
On modern Linux hosts, the **systemd journal** is usually the highest-value source for **service execution**, **auth events**, **package operations**, and **kernel/user-space messages**. During live response, try to preserve both the **persistent** journal (`/var/log/journal/`) and the **runtime** journal (`/run/log/journal/`) because short-lived attacker activity may only exist in the latter.
328
+
329
+
```bash
330
+
# List available boots and pivot around the suspicious one
331
+
journalctl --list-boots
332
+
journalctl -b -1
333
+
334
+
# Review a mounted image or copied journal directory offline
# Inspect a single journal file and check integrity/corruption
339
+
journalctl --file system.journal --header
340
+
journalctl --file system.journal --verify
341
+
342
+
# High-signal filters
343
+
journalctl -u ssh.service
344
+
journalctl _SYSTEMD_UNIT=cron.service
345
+
journalctl _UID=0
346
+
journalctl _EXE=/usr/sbin/useradd
347
+
```
348
+
349
+
Useful journal fields for triage include `_SYSTEMD_UNIT`, `_EXE`, `_COMM`, `_CMDLINE`, `_UID`, `_GID`, `_PID`, `_BOOT_ID`, and `MESSAGE`. If journald was configured without persistent storage, expect only recent data under `/run/log/journal/`.
350
+
351
+
### Audit framework triage (`auditd`)
352
+
353
+
If `auditd` is enabled, prefer it whenever you need **process attribution** for file changes, command execution, login activity, or package installation.
**Linux maintains a command history for each user**, stored in:
302
378
303
379
-\~/.bash_history
@@ -413,6 +489,28 @@ Useful fields:
413
489
-**dtime**: deletion timestamp set when the inode was unlinked.
414
490
-**ctime/mtime**: helps correlate metadata/content changes with incident timeline.
415
491
492
+
### Capabilities, xattrs, and preload-based userland rootkits
493
+
494
+
Modern Linux persistence often avoids obvious `setuid` binaries and instead abuses **file capabilities**, **extended attributes**, and the dynamic loader.
Pay special attention to libraries referenced from **writable** paths such as `/tmp`, `/dev/shm`, `/var/tmp`, or odd locations under `/usr/local/lib`. Also check for capability-bearing binaries outside normal package ownership and correlate them with package verification results (`rpm -Va`, `dpkg --verify`, `debsums`).
-**Book: Malware Forensics Field Guide for Linux Systems: Digital Forensics Field Guides**
457
555
458
556
-[Red Canary – Patching for persistence: How DripDropper Linux malware moves through the cloud](https://redcanary.com/blog/threat-intelligence/dripdropper-linux-malware/)
557
+
-[Forensic Analysis of Linux Journals](https://stuxnet999.github.io/dfir/linux-journal-forensics/)
558
+
-[Red Hat Enterprise Linux 9 - Auditing the system](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/security_hardening/auditing-the-system_security-hardening)
0 commit comments