Linux powers most of the internet. Web servers, cloud infrastructure, Docker containers, Kubernetes clusters, IoT devices, and increasingly laptops run on it. When one of those systems is compromised, or a crime is committed using one, a forensic examiner has to answer three questions: what happened, when, and who did it. Linux forensics is the discipline of answering those questions from the evidence a Linux system leaves behind.
For a long time the digital forensics world revolved around Windows. But the reality of modern deployments is that Linux is everywhere:
The good news for examiners is that Linux is unusually transparent. Most services log by default, the filesystem records metadata you can inspect without proprietary tools, and almost every forensic tool that exists for Linux is open source — which means you can read the source of both the tool and the code being analyzed.
A running Linux system is constantly writing evidence. The main categories are:
| Category | Examples | Where it lives |
|---|---|---|
| System logs | auth, syslog, cron, kernel | /var/log |
| Journal | systemd journal (structured) | /var/log/journal |
| User activity | shell history, browser, dotfiles | /home/<user> |
| Process data | running commands, open files | /proc (live only) |
| Config changes | authentication, services, cron | /etc |
| Filesystem metadata | MAC times, deleted inodes | raw disk image |
| Memory | processes, network, injected code | RAM dump |
Add to this the artifacts applications create: browser history, shell command history, editor swap files, package-manager logs, thumbnails, trash directories, and the many side-effects of the "everything is a file" design. Each one is a breadcrumb.
Every decision in an investigation should be guided by a handful of principles:
The single most important rule. A forensics workstation should never have the suspect drive auto-mounted, and analysis must happen on a copy (an image), never the original. Even reading a filesystem mounts and modifies it.
Every command you run, every file you open, every hash you compute must be recorded. If it isn't written down, it didn't happen — and your report will be torn apart by whoever opposes you in court.
Use dd or dcfldd to image the evidence drive to a forensic image,
verify the hash (SHA-256 / MD5) matches, and only then analyze the image.
Evidence has a lifetime. RAM vanishes the moment you power down the machine. Follow the order of volatility: memory, network state, live processes, temporary files, then disk.
If a case reaches court, you must be able to prove that the evidence you analyze is the evidence that was seized, unchanged. That means:
# on the live target (as root), hash the drive BEFORE imaging
sha256sum /dev/sda > original.sha256
# on the forensic workstation, hash the image AFTER imaging
sha256sum -c original.sha256 # expects path match
A practical investigation on a Linux box follows a natural sequence, each stage covered elsewhere on this site: