CyberKit

Linux Artifacts

Linux forensic artifacts, indexed by the question each one answers.

Linux has fewer purpose-built artifacts than Windows and more that depend on configuration. Shell history, auditd and journald can answer a lot or almost nothing depending on settings applied long before the incident.

Before you read the table

  • Paths differ by family. Debian and Ubuntu log to /var/log/auth.log. RHEL and Fedora use /var/log/secure.
  • journald is volatile by default on several distributions. Without Storage=persistent it lives in /run and does not survive a reboot.
  • auditd records nothing without rules. Its silence describes the configuration, not the activity.
  • syslog-style lines carry no offset. Find the host's zone before you build a timeline.

23 rows.

Linux artifacts
PathQuestionWhat it records
/var/log/auth.logWho logged in, from where, and what failed?sshd accepts and failures, sudo invocations with the command run, su, PAM decisions, and user and group changes. The first log to read on almost any Linux investigation.
/var/log/wtmp · /var/log/btmp · /var/run/utmpWhat is the login history, including failures?wtmp holds successful logins and logouts, btmp holds failed attempts, utmp holds sessions active right now. All three are binary and are read with last, lastb and w.
/etc/passwd · /etc/shadow · /etc/groupWhat accounts exist, and which can log in?Accounts, UIDs, shells and group membership. A UID of 0 on anything other than root is an immediate finding, as is a service account whose shell has been changed from nologin to a real one.
/etc/sudoers · /etc/sudoers.d/Who can escalate, and to what?Sudo rules, including NOPASSWD entries and command restrictions. A dropped file in sudoers.d is quieter than editing the main file.
~/.bash_history · ~/.zsh_historyWhat commands did this user type?Typed shell commands per user. Frequently the most directly probative artifact on a compromised Linux host, and the one that reads most clearly in a report.
/var/log/audit/audit.logWhat executed, with which arguments, under which identity?auditd records: execve calls, file access against watched paths, syscalls, and identity changes. The closest Linux equivalent to detailed process auditing on Windows.
/proc/<pid>/What is running right now, and from where?cmdline, exe (a symlink to the real binary), cwd, environ and the open file descriptors, per process. exe still resolves when the binary has been deleted from disk, which is how you recover a running-but-deleted implant.
/var/log/dpkg.logWhat software was installed or removed, and when?Package manager activity with timestamps. Attacker-installed tooling frequently arrives this way and is dated precisely.
/etc/systemd/system/ · /lib/systemd/system/ · ~/.config/systemd/user/What runs as a service, and what starts it?systemd unit files. ExecStart is the command, and a unit under a user's own ~/.config/systemd/user runs without any root involvement at all, which is the variant reviews miss.
systemd timersWhat is scheduled to run, outside cron?Timer units and their next and last elapse times. The modern replacement for cron, and correspondingly less often checked.
/etc/crontab · /etc/cron.d/ · /var/spool/cron/crontabs/What is scheduled through cron?System and per-user cron jobs. The per-user spool is the one to check for every account, not just root.
~/.ssh/authorized_keysWho can log in as this user without a password?Public keys accepted for this account. An added key is the quietest and most durable Linux persistence there is: it survives password changes, needs no malware, and looks exactly like legitimate administration.
/etc/ld.so.preloadIs a library being injected into every process?Libraries force-loaded into every dynamically linked binary on the system. This is the classic userland rootkit mechanism, and the file does not exist on a clean system.
/etc/rc.local · /etc/init.d/What runs at boot through the legacy paths?SysV-era startup scripts, still honored on many systems for compatibility and correspondingly under-monitored.
/etc/update-motd.d/Does anything execute on every SSH login?Scripts run to build the message of the day, executed as root on each interactive login. Rarely reviewed and an effective trigger.
~/.ssh/known_hostsWhere did this account SSH out to?Hosts this account has connected to. Direct evidence of lateral movement from this machine.
~/.viminfo · ~/.lesshst · ~/.mysql_historyWhat files were opened or queried, outside the shell?Editor and pager histories, including the files opened and search terms used, plus database client history. Consistently overlooked and often more candid than the shell history.
/tmp · /dev/shm · /var/tmpWhat was staged?World-writable directories, and the usual staging ground for downloaded tooling and archives awaiting exfiltration. /dev/shm is memory-backed, so its contents never touch disk and vanish at reboot.
/var/log/journal/ (journald)What does the system log say, on a systemd host?The binary journal: service starts and stops, kernel messages, authentication, and anything applications log through it.
/etc/os-release · /proc/version · uname -aWhat is this host, and what kernel is it running?Distribution, version and kernel. Decides which artifact paths apply and which exploits were even possible.
/etc/localtime · /etc/timezoneWhat timezone is this host in?The timezone the local-time log entries are written in. Read it before building any timeline, because syslog-style entries carry no offset.
/etc/hosts · /etc/resolv.confHow does this host resolve names?Static host entries and configured resolvers. An added hosts entry redirects traffic with no network-layer evidence at all, and a changed resolver sends every lookup somewhere new.
/etc/ssh/sshd_configHow is remote access configured?PermitRootLogin, PasswordAuthentication, AuthorizedKeysFile and any Match blocks. Attackers weaken this to keep access, and a Match block is the quiet way to do it for one account.

Related

All references