Linux Services, Processes & Logs
Understand running processes, systemd services, resource use and logs during a host investigation.
Educational reference drafted for the Nullwire archive. This is not a claim of completed training or original research; verify examples and customise before presenting it as finished work.
Objective
Trace a running Linux service from its process to its configuration and logs, while keeping changes out of the investigation.
Map the processes
Start with a system-wide overview:
ps aux
top
ps aux is a snapshot; top is a continuously updating view. CPU utilisation alone is not a security signal: explain what process is active, its owner and what workload should be expected.
Inspect listening sockets:
ss -lnt
The -l flag selects listeners, -n avoids name resolution and -t restricts the output to TCP. If you need process ownership on your own machine, ss -lntp may require elevated privileges.
Examine services
Many Linux distributions use systemd:
systemctl --failed
systemctl status ssh
systemctl list-unit-files --type=service
Service names differ by distribution; ssh might be called sshd. Failed units can be ordinary configuration problems, not necessarily compromises.
Read the journal
Query journal entries without changing the underlying service:
journalctl -b -p warning --no-pager
journalctl -u ssh --since "1 hour ago" --no-pager
The second command filters by service name and a recent window. On a real incident, record the timezone and preserve relevant logs before rotation.
Guided exercise
Pick a noncritical service in your own lab. Document its purpose, execution account, executable path, listening ports, dependencies and normal log messages. Then restart the service only in your disposable lab, and compare the observations.
Investigation checklist
- What is the expected service behaviour?
- Who launched it and with which privileges?
- What network connections are associated with it?
- What changed before the first unusual event?
Next: Detection Engineering.