When an endpoint shows signs of compromise, the natural instinct is often to log in, poke around running processes, and reboot the machine to restore services. In a security incident, this reaction can destroy the very artifacts you need to identify the root cause. A hasty reboot erases volatile memory, while opening files updates system timestamps and overwrites attacker traces.
Digital forensics is the disciplined practice of identifying, preserving, analyzing, and presenting electronic data. Whether you are responding to an internal breach, dealing with ransomware, or helping an auditor understand an unauthorized transfer, your findings depend entirely on the integrity of your initial collection. This guide covers the core principles of evidence handling, the order of volatility, and practical acquisition steps for security analysts and systems administrators.
Why Proper Evidence Handling Matters
Security investigations rarely happen in a vacuum. A compromised server might lead to a compliance audit, an insurance claim, or an operational debrief with legal counsel. In all of these scenarios, your technical findings must withstand scrutiny.
If you cannot prove that a system image is an exact, unaltered replica of the machine at the time of seizure, your conclusions lose their weight. More practically, acquiring evidence incorrectly risks altering metadata such as access times (atime), overwriting RAM, or even triggering anti-forensic scripts planted by an adversary. Preserving data properly ensures that your incident analysis reflects what actually took place.
Core Concepts: Volatility and Chain of Custody
Two foundational concepts govern all digital forensics work: the order of volatility and the chain of custody.
The Order of Volatility
RFC 3227 establishes guidelines for evidence collection based on the speed at which data disappears. When triaging a live system, you should always collect the most volatile data first:
- Registers and processor cache: Lost within nanoseconds.
- Routing tables, ARP cache, process tables, kernel statistics, and physical memory (RAM): Lost immediately upon system shutdown or power loss.
- Temporary file systems and swap space: Ephemeral, often cleared or modified during restarts.
- Local hard drives and non-volatile storage: Persistent across reboots.
- Remote logs and network data: Kept on separate servers, retained according to organization policies.
- Archival media and backup tapes: Long-term storage.
Because physical memory contains running malware artifacts, active network connections, injected DLLs, and decrypted keys, you must capture it before powering down the machine or copying hard drive contents.
Chain of Custody
A chain of custody is a chronological record that documents who collected the evidence, when it was collected, where it was stored, and who accessed it. If an artifact leaves your sight or moves between team members, the transfer must be logged. A basic chain of custody log should document:
- Case reference number and device identifier (e.g., serial number, MAC address).
- Date and timestamp of acquisition (standardized to UTC).
- Name, role, and signature of the person collecting the item.
- Physical condition of the hardware at the time of seizure.
- Storage location and security controls protecting it.
- Cryptographic hashes (such as SHA-256) of all acquired images.
Step-by-Step: Collecting Evidence from a Live System
Before taking action, pause and establish a clear plan. Avoid running interactive graphical tools on the target system, as they consume resources and alter volatile memory.
Step 1: Document the Initial Scene
Note the physical state of the hardware before touching anything. Record what is on the monitor, whether any external storage devices or dongles are connected, and take photographs of the front and back of the machine. Record the system time displayed on the monitor and compare it to a reliable reference time (such as UTC) to calculate any clock skew.
Step 2: Acquire Volatile Memory (RAM)
If the device is powered on, capture volatile memory using a trusted tool executed from an external, write-blocked USB drive. Do not install memory capture software directly onto the target disk.
On Windows systems, command-line utilities such as WinPmem or FTK Imager Lite are commonly used. On Linux environments, kernel modules like LiME (Linux Memory Extractor) or tools such as dd (when accessing /dev/fmem or specialized hardware drivers) capture memory pages.
Once captured, immediately generate a cryptographic hash of the memory raw dump file on your analysis workstation:
sha256sum memdump_host01_20241025.raw > memdump_host01_20241025.raw.sha256
Step 3: Isolate and Power Down
Once volatile memory is captured, decide how to handle the storage drive. Disconnect the system from all network interfaces—unplug Ethernet cables and disable Wi-Fi switches—to prevent remote access or lateral movement.
For standard desktop systems and servers where full-disk encryption (such as BitLocker or LUKS) is known to be inactive, pulling the power plug directly from the back of the device preserves the current disk state. Note that if full-disk encryption is active and the recovery keys are unknown, pulling the plug will lock the disk; in that scenario, you may need to acquire a live disk image while the volume remains mounted.
Step 4: Image the Drive with Hardware Write Blockers
Whenever possible, remove the storage drive from the suspect chassis and connect it to a forensic imaging workstation through a hardware write blocker. A write blocker physically intercepts write commands sent from the host operating system, preventing accidental modification of disk sectors.
Create a bit-stream disk image (a raw bit-for-bit copy) using utilities like dc3dd, dcfldd, or standard dd. These specialized tools can calculate hashes on the fly and handle bad sectors gracefully.
# Example: Imaging a drive using dc3dd with SHA-256 verification
sudo dc3dd if=/dev/sdb of=/evidence/host01_drive.raw hash=sha256 log=/evidence/host01_imaging.log
The output provides an exact byte-for-byte image file alongside the calculated hash. Compare this hash against a verification pass to ensure no sectors were altered during the read.
Step 5: Work Only from Forensic Duplicates
Place the original drive and the primary forensic master image into secure, read-only storage. Generate a second copy (a working copy) of the disk image to perform your actual analysis. Perform timeline reconstruction, file carving, and string extraction on the working copy so that your primary evidence remains untouched.
Common Mistakes to Avoid
Forensic missteps usually stem from a desire to remediate the system too quickly. Watch out for these common traps:
- Running standard tools directly from the target drive: Launching programs already installed on the machine executes binaries that might be subverted by an attacker. Always run lightweight forensic utilities from trusted external media.
- Shutting down via the operating system menu: Initiating a normal graceful shutdown runs logoff scripts, flushes caches, updates registry hives, and terminates background malware processes before you can capture them.
- Failing to hash immediately: If you take a disk image and calculate the hash two days later, you cannot prove that the file was not altered in the interim. Always hash at the time of creation.
- Neglecting system clock offset: If a target machine is running twelve minutes behind standard time, your event timeline will misalign with firewall and proxy logs. Document the system clock offset early.
Forensic Collection Checklist
- Photographed physical machine, cable connections, and display screen.
- Documented reference time, system clock time, and calculated time drift.
- Captured volatile memory to external media prior to shutting down.
- Network interfaces disconnected to isolate the device.
- Used a hardware or software write-blocker before mounting the storage media.
- Acquired a bit-stream disk image (raw or E01 format).
- Calculated SHA-256 hashes of the target device and the resulting image.
- Completed chain of custody documentation with dates, times, and signatures.
- Stored the master image on read-only media and conducted analysis on a duplicate.





