MicroadsTeam Cyber by Microads, since 2015 Report an incident

Incident response

Preserving digital evidence without slowing recovery

Preserving digital evidence during an incident without delaying recovery. Memory capture, triage versus full images, log exports and chain of custody.

Systems are down, people want them back, and someone has asked whether you need to “keep evidence”. You do, and preserving digital evidence doesn’t have to cost you recovery time if a few decisions are made early and in the right order.

Why preserving digital evidence feels like it competes with recovery

The tension is real. The recovery team wants to reimage, restore and move on. The evidence you need to answer “how did they get in?” and “what did they take?” lives on exactly the machines being wiped. If nobody makes a call, recovery wins by default, and three weeks later the insurer, a regulator or your own board asks a question nobody can answer.

The fix is mostly organizational. Name one person as evidence lead. Their job isn’t to slow anything down. It’s to make sure nothing gets wiped until it has been collected or consciously written off. A triage collection takes minutes per host. Losing patient zero takes you out of the root-cause conversation for good.

RFC 3227, published in 2002 and still the clearest statement of the principle, sets out the order of volatility: collect what disappears fastest first. Roughly, that runs from CPU registers and cache, through routing and ARP tables, the process table, kernel statistics and memory, then temporary file systems, then disk, then remote logging and monitoring data, then physical configuration, and finally archival media. Nobody is grabbing CPU registers during a ransomware outage. The ordering still drives every decision below.

Decision one: capture memory before anyone reboots?

Memory holds what disk often doesn’t: running processes, injected code, live network connections, decrypted payloads, PowerShell that never touched a file, and sometimes credentials or keys. A reboot or power-off destroys all of it.

So the default should be to isolate, not power off. Most EDR platforms can network-contain a host while leaving it running, which stops spread and keeps memory intact. Then capture memory with WinPmem, DumpIt or Magnet RAM Capture on Windows, or AVML or LiME on Linux. Write the image to external media or a network share, not to the suspect disk if you can avoid it. On virtual machines, a snapshot or suspend that includes memory state (the .vmem file on VMware, saved state on Hyper-V) does the same job with less fuss.

The trade-off: memory capture costs minutes per machine and needs someone at the keyboard or an agent already deployed. You don’t need it from two hundred encrypted laptops. You do want it from the first host that showed attacker activity, any server where you’ve seen suspicious processes, and domain controllers the attacker logged on to.

There is one clear exception. If encryption or deletion is actively running and you can’t isolate the host any other way, pull the power or the cable. Stopping damage beats preserving evidence. Write down that you did it, and when.

Field note: If a laptop was already hibernated, hiberfil.sys holds a compressed copy of memory from that moment. Don’t boot it up “to have a look”. Image the disk first.

Decision two: full disk image or triage collection?

A full forensic image (E01 or raw, taken with FTK Imager, dd or a hardware imager) is a complete copy of the disk, unallocated space and deleted files included. A triage collection grabs the artifacts that answer most incident questions at a fraction of the size. For most hosts in most incidents, triage is the right call.

CollectionWhat you getEffortUse it when
Memory captureProcesses, connections, injected code, in-memory artifactsMinutes; scales with RAMThe host is still running and the attacker touched it
Triage collectionEvent logs, registry hives, $MFT, prefetch, Amcache, SRUM, scheduled tasks, shell historyMinutes per host, often remoteDefault for every affected host before it is reimaged
Full disk imageEverything, including deleted files and slack spaceHours; scales with disk sizePatient zero, likely litigation, insider cases, or counsel asks
Cloud volume snapshotPoint-in-time copy of an EBS volume or managed diskMinutes to startCloud workloads; snapshot first, analyze later

Tools like KAPE and Velociraptor on Windows, or UAC (the Unix-like Artifacts Collector) on Linux and macOS, make triage repeatable. On Linux, make sure you get /var/log, auth logs, shell histories, crontabs, systemd units and every authorized_keys file. On Windows, the Security, System and PowerShell Operational logs carry most of the story: 4624 and 4625 for logons, 4688 for process creation if it was enabled, 7045 for new services, 1102 if someone cleared the Security log.

Take a full image of the host where it started, of anything likely to end up in court or an employment dispute, and of whatever counsel tells you to image. Otherwise, triage, keep the snapshot or backup, and move on.

Decision three: which logs expire before you get to them?

This is the evidence that gets lost by doing nothing at all. Firewall and VPN appliances often keep local logs in a rolling buffer. EDR telemetry is kept for whatever period your license sets. Cloud logs have their own windows: AWS CloudTrail event history covers 90 days of management events, and Microsoft 365 audit and sign-in log retention depends on your plan.

On day one, export:

  • Firewall, VPN and RADIUS logs covering the suspected dwell time, plus a margin either side
  • Microsoft 365 or Google Workspace audit and sign-in logs for affected users
  • CloudTrail, plus any S3 server access logs and VPC Flow Logs that exist
  • EDR detections and timeline data for affected hosts
  • Email gateway logs, if phishing is a candidate entry point

Put the exports in storage the attacker can’t reach, ideally a separate account with write-once settings, and hash them as they land.

Chain of custody and hashing, kept light

Chain of custody sounds heavier than it is. A shared spreadsheet is fine, as long as one person owns it. For each item, record an ID, what it is, where it came from (hostname, serial number, account), who collected it, when (in UTC, and say so), how (tool and version), its hash, where it’s stored, and every time it moves or someone gets a copy.

Hash at collection and again on every transfer. SHA-256 is the sensible default.

Get-FileHash -Algorithm SHA256 .\FS01-memory.raw
sha256sum FS01-disk.E01

If a hash doesn’t match later, you want to find out why before somebody else asks. It feels like overhead in the middle of a crisis. It’s ten minutes of discipline that decides whether the evidence counts. NIST SP 800-61 Rev. 3 treats evidence handling as part of the response rather than an afterthought, which is the right way to think about it.

The machine was already reimaged. What’s left?

More than people assume. That host’s local artifacts are gone, but the attacker left traces elsewhere:

  • Domain controllers recorded logons involving that host (4624 type 3 and type 10) and any accounts created or added to groups (4720, 4732).
  • Neighboring servers hold their own records of lateral movement: service installs, scheduled tasks, RDP logons.
  • Central logging, if you forward events to a SIEM, has copies of what the host sent before it was wiped.
  • EDR consoles often keep process and network telemetry after the endpoint itself is gone.
  • Backups and snapshots taken before the rebuild contain the disk as it was. Restore one into an isolated environment and collect from it as you would from a live host.
  • Network logs from the firewall, proxy, DNS and VPN show what the host talked to.

Be honest in the report about what was lost. “The host was reimaged before collection, so activity on it cannot be fully determined” is a perfectly acceptable sentence. Pretending otherwise causes trouble later, when someone relies on your scope to decide whether a data breach notification is required.

If you’re in the middle of it, the next step is short: pick an evidence lead, isolate rather than power off, and run a triage collection on every host before it joins the rebuild queue. Our posts on the first hour of a cyber incident and the first 48 hours of ransomware show where this fits in the wider response. If you need people running collection while your own team runs recovery, tell us what’s happening and our emergency incident response team will take it from there.

Dealing with this right now?

A responder will acknowledge your report within 15 minutes, 24/7.

Related service: Emergency Incident Response