Home/Refreshers/Linux host triage: refresher
Linux host triage
What to capture first on a suspect Linux machine, where persistence hides, and which logs matter.
Remember
- Do not reboot. Memory, connections, and programs running from deleted files are lost.
- In the cloud, snapshot the disk first, then capture memory with AVML.
- Record uname -r before capture. Volatility 3 needs symbols for that exact kernel.
- Run your own static tools. The machine's may have been replaced.
| Persistence | Where |
|---|---|
| Scheduled jobs | /etc/crontab, /etc/cron.*, /var/spool/cron/, systemctl list-timers --all |
| Services | /etc/systemd/system/, ~/.config/systemd/user/ |
| SSH keys | every authorized_keys, and AuthorizedKeysFile in sshd -T |
| Library preloading | /etc/ld.so.preload, usually empty or missing |
| Accounts and sign-in | /etc/passwd, /etc/sudoers.d/, /etc/pam.d/ |
| Cloud start-up | /var/lib/cloud/instance/user-data.txt, /var/log/cloud-init.log |
Live state
| Processes, with start times | ps -eo pid,ppid,user,lstart,args |
| Connections | ss -tunap |
| Programs running from deleted files | ls -l /proc/*/exe 2>/dev/null | grep deleted |
| Deleted files still open | lsof -nP +L1 |
| Sign-ins, good and failed | last; lastb |
Watch out
- Reading the instance's credentials from the metadata service leaves no trace on the host. Look for the role used elsewhere in the cloud audit log.
- Attackers clear local logs first. A copy shipped off the machine is the one to trust.
Check it worked
Every item collected has a hash, a time, and your name, and the disk snapshot was taken before memory capture.