DFIR Workflow Cheatsheet

Purpose: Systematic approach to investigating Linux system compromises Scope: Detection through Root Cause Analysis


Investigation Phases Overview

Phase
Name
Primary Focus
Key Outputs

1

Detection & Initial Triage

Identify scope, assess criticality, make containment decisions

Triage report, scope determination, initial IOCs

2

Evidence Collection

Preserve volatile data, acquire memory and disk images

Memory dump, disk image, live collection archive

3

Live System Analysis

Examine running processes, network connections, user sessions

Process tree, network map, active threat identification

4

Filesystem Analysis

Hunt for malicious files, check integrity, find webshells

Suspicious file inventory, integrity violations

5

Log Analysis

Parse authentication, system, and audit logs for anomalies

Authentication timeline, privilege escalation events

6

Memory Forensics

Analyze RAM for hidden processes, injected code, credentials

Hidden artifacts, malware in memory, encryption keys

7

Persistence Mechanisms

Identify all attacker footholds for maintaining access

Complete persistence inventory, removal checklist

8

Timeline Analysis

Correlate events across all sources chronologically

Master timeline, attack sequence reconstruction

9

Root Cause Analysis

Determine initial access vector and contributing factors

Attack vector, vulnerability identification, gaps

10

Containment & Remediation

Eradicate threat and harden environment

IOC package, remediation plan, lessons learned

Investigation Flow:

Stage
Phases
Objective

Initial Response

1 → 2

Assess and preserve

Active Analysis

3 → 4 → 5 → 6

Understand the compromise

Deep Dive

7 → 8

Map persistence and timeline

Resolution

9 → 10

Determine cause and remediate


Phase 1: Incident Detection & Initial Triage

1.1 Detection Sources

What triggered the investigation?

Source
Indicators
Priority

EDR/XDR Alerts

Process anomalies, suspicious executions

High

SIEM Alerts

Log-based detections, correlation rules

High

Network IDS/IPS

C2 traffic, lateral movement

High

User Reports

Unusual system behavior

Medium

Threat Intelligence

IOC matches

Medium

Scheduled Scans

Malware detection, rootkit detection

Medium

1.2 Initial Triage Questions

1.3 Rapid Triage Commands

System Identity & Context

Active User Sessions

Network Quick Check

Process Quick Check

1.4 Triage Decision Matrix

Finding
Risk Level
Immediate Action

Active C2 connection

Critical

Isolate network, preserve state

Cryptominer running

High

Document, consider isolation

Unauthorized SSH sessions

Critical

Identify source, isolate

Modified system binaries

Critical

Isolate, full forensic capture

Suspicious cron jobs

High

Document, continue investigation

Unknown listening ports

Medium

Identify process, assess risk


Phase 2: Evidence Collection & Preservation

2.1 Order of Volatility

Collect evidence in this order (most volatile first):

2.2 Live Evidence Collection Script

2.3 Memory Acquisition

Using LiME (Linux Memory Extractor)

Using /proc/kcore (Less Reliable)

2.4 Disk Imaging

Full Disk Image

Verify Image Integrity


Phase 3: Live System Analysis

3.1 Process Investigation

Identify Suspicious Processes

Process Deep Dive

What to Look For - Processes

3.2 Network Investigation

Active Connections Analysis

Network Configuration

What to Look For - Network

3.3 User Account Investigation

User Account Analysis

SSH Key Investigation

What to Look For - Users


Phase 4: Filesystem Analysis

4.1 File Timeline Analysis

Recently Modified Files

SUID/SGID File Analysis

4.2 Suspicious File Locations

4.3 Binary Analysis

Quick Binary Triage

Package Integrity Verification

4.4 Web Shell Detection

4.5 What to Look For - Filesystem


Phase 5: Log Analysis

5.1 Key Log Locations

Log File
Content
Distribution

/var/log/auth.log

Authentication events

Debian/Ubuntu

/var/log/secure

Authentication events

RHEL/CentOS

/var/log/syslog

General system messages

Debian/Ubuntu

/var/log/messages

General system messages

RHEL/CentOS

/var/log/kern.log

Kernel messages

All

/var/log/audit/audit.log

Auditd events

All (if enabled)

/var/log/cron

Cron job execution

All

/var/log/wtmp

Login records (binary)

All

/var/log/btmp

Failed login attempts (binary)

All

/var/log/lastlog

Last login info (binary)

All

/var/log/faillog

Failed login attempts

All

~/.bash_history

User command history

All

5.2 Authentication Log Analysis

SSH Authentication Events

Sudo/Privilege Escalation Events

User Account Changes

5.3 System Log Analysis

System Events

Audit Log Analysis (auditd)

5.4 Binary Log Analysis

wtmp/btmp Analysis

5.5 Shell History Analysis

5.6 Journald Analysis

5.7 What to Look For - Logs


Phase 6: Memory Forensics

6.1 Memory Acquisition

LiME Method

AVML Method

6.2 Memory Analysis with Volatility 3

Setup and Profile

Process Analysis

Network Analysis

Module Analysis

File Analysis

Rootkit Detection

6.3 What to Look For - Memory


Phase 7: Persistence Mechanism Analysis

7.1 Cron-Based Persistence

7.2 Systemd Persistence

7.3 Init Script Persistence

7.4 Shell Configuration Persistence

7.5 SSH Persistence

7.6 Library Preloading Persistence

7.7 Kernel Module Persistence

7.8 Additional Persistence Locations

7.9 Persistence Detection Summary

Location
Check Command
Risk Level

Crontabs

crontab -l; cat /etc/crontab

High

Systemd services

systemctl list-unit-files --type=service

High

SSH authorized_keys

find / -name authorized_keys

Critical

Shell profiles

cat ~/.bashrc ~/.profile

High

LD_PRELOAD

cat /etc/ld.so.preload

Critical

Kernel modules

lsmod; cat /etc/modules

Critical

Init scripts

ls /etc/init.d/

Medium

At jobs

atq

Medium

Systemd timers

systemctl list-timers

High


Phase 8: Timeline Analysis

8.1 Timeline Generation

Using find for Timeline Data

Using Plaso/log2timeline

8.2 Timeline Correlation

Identify Key Events

8.3 Timeline Analysis Focus Areas


Phase 9: Root Cause Analysis

9.1 Attack Vector Identification

Common Initial Access Vectors

Vector
Evidence Sources
Key Indicators

SSH Brute Force

auth.log, btmp

Multiple failed attempts, eventual success

SSH Key Compromise

authorized_keys

Unauthorized key, timeline analysis

Web Application Exploit

Web logs, webshells

POST requests, new files in webroot

Supply Chain

Package logs

Modified packages, unusual updates

Credential Theft

auth.log

Login from unusual IP/time

Vulnerable Service

Service logs

Exploitation patterns, crashes

Investigation Checklist

9.2 Vulnerability Assessment

9.3 Attack Reconstruction

Build Attack Narrative

9.4 Impact Assessment

9.5 Root Cause Categories

Category
Examples
Remediation Focus

Vulnerability

Unpatched software, zero-day

Patch management, WAF

Configuration

Default credentials, open ports

Hardening, CIS benchmarks

Credential

Weak passwords, reused creds

MFA, password policy

Human

Phishing, social engineering

Security awareness

Supply Chain

Compromised package, update

Vendor management, integrity checks

Insider

Malicious employee

Access controls, monitoring


Phase 10: Containment & Remediation Recommendations

10.1 Immediate Containment Actions

10.2 Remediation Checklist

10.3 Indicators of Compromise (IOC) Documentation

IOC Summary Template

File Indicators

Type
Value
Context

SHA256

Malicious binary

Filename

Dropped file

Path

Persistence location

Network Indicators

Type
Value
Context

IP

C2 server

Domain

Malware download

Port

Backdoor listener

Host Indicators

Type
Value
Context

Username

Created by attacker

Process

Malicious process

Service

Persistence mechanism

Behavioural Indicators

  • Encoded PowerShell/Python execution

  • Cron job running from /tmp

  • SSH connections at unusual hours

  • Large outbound data transfers


Quick Reference: Essential Commands

System Overview

Process Hunting

Network Hunting

File Hunting

Log Hunting

Persistence Hunting


Appendix A: Tool Installation

Essential DFIR Tools

LiME Installation

Volatility 3 Installation


Appendix B: Investigation Documentation Template

Linux DFIR Investigation Report

Case Information

  • Case ID:

  • Investigator:

  • Date Started:

  • Date Completed:

  • System(s) Investigated:

Executive Summary

[Brief overview of incident and findings]

Timeline of Events

Date/Time
Event
Source
Notes

Technical Findings

Initial Access

  • Vector:

  • Timestamp:

  • Evidence:

Persistence Mechanisms

Lateral Movement

  • Systems accessed:

  • Methods used:

Data Impact

  • Data accessed:

  • Data exfiltrated:

Indicators of Compromise

[IOC table]

Root Cause Analysis

[Detailed analysis]

Recommendations

Evidence Inventory

Item
Description
Hash
Location

Appendices

  • Raw evidence files

  • Full command outputs

  • Screenshots


Last updated