In this section
LX0.1 Why Linux IR Is Different
Why Linux Incident Response Is Fundamentally Different from Windows
The evidence architecture divide
If you have investigated incidents on Windows, you carry a mental model of where evidence lives. The registry records program execution, service configuration, user activity, and system state changes. The NTFS Master File Table records every file creation, modification, and deletion with nanosecond precision. Prefetch files record the first and last eight execution times of every program. The Windows Event Log provides a structured, indexed record of authentication events, process creation, service changes, and security policy modifications. LSASS holds cached credentials in memory. The AMSI interface captures script execution content. The WMI repository records persistent event subscriptions.
None of these exist on Linux.
That statement is not an exaggeration or a simplification. Linux does not have a registry — configuration is stored in text files scattered across /etc, /home, and application-specific directories. Linux does not have Prefetch — there is no built-in mechanism that records which programs were executed, when, and how many times. Linux does not have a Master File Table that records every file operation with nanosecond timestamps — the ext4 filesystem records four timestamps per inode, but the most forensically valuable one (crtime, the creation time) was not even exposed to userspace tools until kernel 4.11 in 2017, and many forensic tools still do not parse it correctly. Linux does not have a unified Event Log — log data is split across syslog, journald, auditd, application-specific log files, and kernel ring buffers, each with different formats, different retention policies, and different levels of tamper resistance.
# Check if the compromised system is configured for IP forwarding
# IP forwarding enabled means the system can route traffic between
# network interfaces — a strong lateral movement indicator
cat /proc/sys/net/ipv4/ip_forward
# Output: 0 = disabled (normal for a server)
# 1 = enabled (suspicious unless this is a router/gateway)
# Check the persistent configuration (survives reboot)
grep -r "ip_forward" /etc/sysctl.conf /etc/sysctl.d/
# If net.ipv4.ip_forward = 1 appears in a config file, someone
# enabled forwarding deliberately — check the file's modification
# timestamp to determine when# The five directories an investigator checks first on any Linux system
# Run these commands to get an immediate sense of what evidence exists
# 1. Authentication and system events — the primary log directory
ls -la /var/log/auth.log* /var/log/secure* /var/log/syslog* 2>/dev/null
# Shows: which authentication logs exist, how many rotated copies,
# file sizes (empty = truncated by attacker), timestamps (last write)
# 2. Process state — what is running RIGHT NOW
ls /proc/ | grep -E '^[0-9]+$' | wc -l
# Shows: number of running processes. Compare against ps output
# later — a discrepancy indicates a rootkit hiding processes
# 3. System configuration — what the attacker may have modified
stat /etc/passwd /etc/shadow /etc/sudoers /etc/ssh/sshd_config 2>/dev/null | grep -E 'File:|Modify:'
# Shows: modification timestamps of critical config files. Recent
# modifications during the compromise window = attacker activity
# 4. User artifacts — command history and SSH keys
ls -la /home/*/.bash_history /root/.bash_history 2>/dev/null
ls -la /home/*/.ssh/authorized_keys /root/.ssh/authorized_keys 2>/dev/null
# Shows: bash history files (empty/missing = anti-forensics) and
# SSH authorized_keys (modified = persistence mechanism deployed)
# 5. Volatile staging areas — attacker tools and payloads
ls -laR /tmp/ /dev/shm/ 2>/dev/null | head -30
# Shows: files in world-writable directories. Attackers stage
# payloads in /tmp and /dev/shm. /dev/shm is RAM-backed and
# contents are lost on reboot — collect immediately# Direct /proc enumeration — rootkit-resistant process discovery
# This reads the kernel's process list directly, bypassing any
# userspace hooks that a rootkit might have installed
for pid in /proc/[0-9]*/; do
p=$(basename "$pid")
cmdline=$(cat /proc/$p/cmdline 2>/dev/null | tr '\0' ' ')
exe=$(readlink -f /proc/$p/exe 2>/dev/null)
user=$(stat -c '%U' /proc/$p 2>/dev/null)
echo "PID=$p USER=$user EXE=$exe CMD=$cmdline"
done > /tmp/proc_enum.txt
# Compare process count: /proc vs ps
proc_count=$(ls -d /proc/[0-9]*/ 2>/dev/null | wc -l)
ps_count=$(ps -e --no-headers | wc -l)
echo "Direct /proc count: $proc_count"
echo "ps command count: $ps_count"
# If proc_count > ps_count, processes are being hidden from ps
# This is a STRONG indicator of a userspace rootkitMyth: "Linux servers don't need the same forensic attention as Windows because Linux is inherently more secure."
Reality: Linux servers are compromised through the same fundamental vectors as Windows systems — weak credentials, unpatched vulnerabilities, misconfigured services, and supply chain attacks. The difference is not in vulnerability but in visibility: most Linux servers lack the EDR agents, centralized logging, and forensic tooling that Windows environments have. The attacker who compromises a Linux web server often operates in an environment with near-zero detection capability. The investigation methodology must compensate for this — using native Linux evidence sources (filesystem timestamps, /proc, log files, auditd if configured) rather than relying on commercial detection tools that may not be deployed.
Decision points: when Linux evidence is richer than Windows
There are specific investigation scenarios where Linux evidence is actually richer than Windows evidence — not despite the distributed model, but because of it.
Process introspection during live response. On Windows, examining a running process's memory mappings, open files, network connections, and environment variables requires specialized tools (Process Explorer, Handle, or a memory dump analyzed with Volatility). On Linux, every one of these is a readable file in /proc/[pid]/: maps (memory mappings), fd/ (open file descriptors as symlinks), net/tcp (network connections), environ (environment variables), cmdline (command-line arguments), exe (symlink to the actual binary). An investigator with only cat and ls can extract more process-level detail from a live Linux system than from a live Windows system without specialized tools.
Configuration visibility. On Windows, determining the exact configuration of a service requires parsing multiple registry hives, examining Group Policy results, and potentially querying WMI. On Linux, every service configuration is a readable text file — cat /etc/ssh/sshd_config shows the complete SSH configuration. cat /etc/systemd/system/malicious.service shows the complete service definition the attacker created. Nothing is hidden behind a binary database format.
Log tamper detection. On Windows, the Event Log uses a binary format (EVTX) that can be tampered with using specialized tools and the tampering may be difficult to detect. On Linux, the systemd journal uses a binary format with internal checksumming — individual entry modification corrupts the journal's integrity checks, making tampering detectable. The investigator can verify journal integrity and know whether the log has been modified.
Troubleshooting: common mistakes when transitioning from Windows to Linux IR
Looking for artifacts that do not exist. The most common mistake: searching for a "Linux registry" or "Linux Prefetch" equivalent. There is none. Do not waste time looking for centralized execution evidence — instead, correlate filesystem timestamps, bash history, and auditd records (if available).
Trusting ps and ss output unconditionally. On Windows, Task Manager and netstat are generally trusted (though they can be manipulated). On Linux, ps and ss are the first tools an attacker hooks with a rootkit. Always supplement standard commands with direct /proc reads, especially when rootkit presence is suspected.
Ignoring the systemd journal. Investigators who are familiar with syslog check /var/log/auth.log and /var/log/syslog but forget about journalctl. The journal contains the same events but in a tamper-resistant binary format. If the attacker truncated the plaintext log files, the journal may still contain the evidence.
Not checking log rotation policy first. On Windows, Event Log retention is configured per log and is typically weeks to months. On Linux, log rotation is configured per file in /etc/logrotate.d/ and may be as short as 4 rotations of weekly files — only 28 days of history. If you do not check the rotation policy first, you may assume evidence is unavailable when it actually exists in a rotated compressed file, or you may assume you have months of history when you actually have only weeks.
Try it yourself
Exercise
On any Linux system you have access to (a VM, a cloud instance, your WSL installation), run the five-directory check from the command block above. Then run the /proc direct enumeration command. Compare the /proc process count against ps -e --no-headers | wc -l. On a clean system, they should match. On a rootkitted system, /proc shows more processes than ps. You are now reading the same evidence sources you will use in every investigation in this course. Save the output — it is your first baseline for comparison if the system is ever compromised.
Beyond this investigation
The Windows-to-Linux transition is the most common challenge for investigators expanding their capability. The architectural differences described in this subsection apply to every investigation scenario in this course — from SSH brute force (LX4) to container compromise (LX9) to cloud VM analysis (LX10). The investigators who struggle are the ones who keep looking for Windows-equivalent artifacts. The investigators who succeed are the ones who learn the Linux evidence model on its own terms.
The key principle: on Windows, you look for specific artifacts. On Linux, you look for specific files and correlate across multiple sources. The evidence is there — it is just organized differently.
Check your understanding:
1. Why does Linux lack a direct equivalent to Windows Prefetch, and what investigation technique replaces it? 2. What is /proc and why is reading it directly more reliable than using commands like ps and netstat during a compromise investigation? 3. An attacker writes a payload to /dev/shm/payload.elf. Why is this location significant from a forensic perspective? 4. Which directory is the primary evidence source for authentication events on a Debian-based Linux system?
You are investigating a Linux server and discover evidence of both a cryptominer (resource abuse) and an SSH key theft (lateral movement preparation). The cryptominer is consuming 95% CPU and impacting production. Which do you address first?
Address the lateral movement first. The cryptominer is visible, noisy, and contained to this server — it is causing performance impact but not spreading. The SSH key theft is silent, potentially already exploited, and may have given the attacker access to additional servers. Contain the lateral movement risk: rotate the stolen SSH keys, check the target servers for unauthorized access, and apply network restrictions. Then address the cryptominer: kill the process, remove the binary and persistence mechanisms. Prioritizing the noisy but contained threat over the silent but spreading threat is the most common Linux IR prioritization mistake.
Get weekly detection and investigation techniques
KQL queries, detection rules, and investigation methods — the same depth as this course, delivered every Tuesday.
No spam. Unsubscribe anytime. ~2,000 security practitioners.