← All articles
Blog

Linux forensics: the artifacts that tell the story of an intrusion

Where the evidence lives on a compromised Linux server, what each source can and cannot prove, and how to line them up into one timeline.

1 December 2026 5 min read

Windows forensics has decades of tooling and training behind it. Linux incident response often still means SSH-ing into a box and running grep across /var/log. Most internet-facing infrastructure runs Linux, so the gap matters.

This is a field guide to the sources that tell the story of a Linux compromise. For each, it covers what the source proves and where it is weak. Examples come from Halden Freight, a demo case we built in which a WordPress server was taken over and used to reach a database server.

Start with the question, not the logs

A Linux server can hold dozens of log sources. Before you open any of them, write down what you need to answer:

  1. How did they get in? Initial access, usually a web app, an exposed service or a stolen credential.
  2. What did they run, as whom? Execution and privilege changes.
  3. What did they leave behind? Persistence.
  4. Where did they go next? Lateral movement.
  5. What did they take? Collection and exfiltration.

Each question has a short list of sources that answer it best.

Initial access: web server logs

For an exploited web application, the access log is usually the first place the attacker appears. In nginx or Apache logs, look for:

  • Scanner noise. Hundreds of requests in a few minutes, often with a tool's user agent. In Halden, 646 requests from one address in 14 minutes.
  • Requests to unusual paths, such as plugin connectors, upload handlers, or .php files inside upload directories.
  • POSTs that change things, especially a single POST followed by GETs to a new file.

Limits. Access logs do not record request bodies by default, so they show that an upload happened, not what was uploaded. They are also easy for an attacker with root to edit. One of the later steps in Halden was the attacker scrubbing their address out of the log with sed.

Execution: auditd, if you have it

If auditd is running with execve rules, it is the closest thing Linux has to a process-creation log. Each record has the process, its arguments, the user ID and the parent process. It turns "the web server was compromised" into "the web server account ran id, then cat wp-config.php, then started a reverse shell, at these times".

Limits.

  • Many distributions do not ship execve auditing by default.
  • auditd records the numeric user ID. If your tooling does not resolve it, a search for www-data will miss records that only say 33.
  • auditd times and web server times for the same action can differ by seconds, from buffering or clock drift. Cite each time from its own source rather than forcing them to agree.

Execution: shell history

.bash_history is often the most readable account of what an attacker typed. It is also the least reliable:

  • No timestamps by default. Unless HISTTIMEFORMAT was set, each line is untimed. It can be placed only relative to other evidence.
  • Written on exit. A session that is killed may never write its history.
  • Easy to switch off. unset HISTFILE or export HISTSIZE=0 is a common early attacker step. That line itself is evidence.

Treat shell history as a story to confirm, not as a timeline. A good tool keeps an untimed line untimed instead of giving it the collection time.

Privilege: auth.log, sudo and su

/var/log/auth.log (or secure on Red Hat family systems) records SSH logons, su and sudo. Together they show who became whom, when:

  • Accepted password or Accepted publickey for SSH logons, with the source address and port.
  • su successes and failures, which show account switching.
  • sudo commands, with the working directory and the command.

In Halden, su deploy succeeded nine minutes after wp-config.php was read, and sudo bash -i followed 31 seconds later. That suggests password reuse. It is not proof, unless the config file's contents show the same password.

Persistence: the usual places

Linux persistence is not exotic. Check these on every case:

LocationWhat to look for
/etc/cron.d/, user crontabs, /etc/crontabNew or changed entries, odd schedules, commands in /tmp or hidden directories
systemd units in /etc/systemd/system/New services, especially ones named to look like real system services
/etc/ld.so.preloadAny entry at all deserves a look
~/.ssh/authorized_keysKeys that do not match your key inventory
/etc/passwdExtra accounts, especially a second UID 0
Shell profile filesCommands added to .bashrc or /etc/profile.d/

Pair each finding with the file system timeline. A service file created a minute after a download from an external address tells a story by itself.

The file system timeline

A bodyfile-style listing of files with their modified, accessed and changed times puts everything else in order. Watch for:

  • New files in odd places, such as hidden directories under /tmp or /var/tmp, or files in web upload directories.
  • Timestomping. touch -r copies the timestamps of a legitimate file onto a malicious one. The change time (ctime) usually still shows the truth, if your listing has it. If it does not, you can say the timestamps fit timestomping but cannot prove it.

Lateral movement: follow the keys

On Linux, attackers usually move with SSH. They use stolen keys or reused passwords. Read the companion article on tracing SSH lateral movement. In short:

  1. find private keys that were read on the first host;
  2. find outbound SSH from that host;
  3. find the matching Accepted publickey on the next host.

Put it on one timeline

Each source above answers part of a question. The investigation is lining them up:

  • Normalise time zones. Syslog often has no year and no zone. Record your assumption.
  • Keep provenance. Every row should trace back to the file and host it came from.
  • Separate observed from inferred. "The file was read" is observed. "The password was reused" is an inference.

This is the work Arcsentry is built to speed up. Its 257 Linux parsers turn these sources into one schema with provenance on every record. It rebuilds sessions from authentication logs, and it labels untimed or uncertain data as such. Its AI investigator can work through the sources in parallel and return a cited timeline. It writes the gaps down rather than filling them in.

How we wrote this

Drafted with AI from evidence in our own lab, with Laura Pompeu responsible for the article. The evidence comes from Halden Freight portal breach (Linux), built and investigated in our lab, so every example can be checked against real records.

Photo of Laura Pompeu
Laura Pompeu
Marketing Manager & Cybersecurity Content Strategist, Proven Data

Laura Pompeu is a Marketing Manager and Cybersecurity Content Strategist with 10+ years of experience across journalism, SEO, and digital marketing. She produces expert-level content on ransomware, incident response, and data recovery for technical and business audiences, and has led multinational content teams across global markets.

LinkedIn

See it on your own evidence. Free for 7 days.

Tell us what you want to investigate. A person replies within one business day with the download and a trial licence.

Request a trial