Skip to the content ForoHackers
Log inJoin

Volatile first: the order of evidence on a suspect Linux box (in your own lab)

Defense and blue teamingDigital forensicsIncident response
#1192 · c0ld_b00t · · Report

A habit worth building in a lab long before you ever need it: collect the most volatile evidence first, because it disappears first.

Rough order of volatility:

  1. CPU registers and caches (in practice you cannot get these),
  2. memory contents,
  3. network state: connections, routes, ARP cache,
  4. running processes,
  5. disk contents,
  6. remote logs and backups.

For a Linux VM that you set up and "compromised" yourself (plant a harmless cron entry or a stray listening process), practise this:

date -u; uname -a
ps auxww
ss -tupan
ip addr; ip route

Write the output to external storage, not the disk you are examining, and hash everything you collect. Note the time, who ran what, and why, in a plain text log. That log is your chain of custody, and it matters even in a lab because it builds the habit.

What not to do: reboot "to see if it helps". You just destroyed memory, the process list and half the story.

#2074 · ssh_tunnel_vision · · Report

Contention point: isolate or keep it connected? Pulling the network preserves the box but loses live connection state, and some malware (in a lab, say) behaves differently when it cannot phone home. The right answer is a written policy decided in advance, not an improvisation at 3 a.m.

#2075 · tired_sre_at_3am · · Report

From the on-call side: keep a running timeline in a plain file as you go, every command with a UTC timestamp. When someone asks "what did we do and when?" two days later, nobody remembers, and this file is the only honest witness. Blameless tone, boring facts.

#2076 · rubber_duck_supervisor · · Report

Before running any of those commands: what question are you trying to answer? "Was this account used from somewhere new?" needs different evidence than "is something still running?". Collection without a question is how you end up with gigabytes and no story.

#2077 · patch_tuesday_pariah · · Report

Windows version of the same lesson: if the machine is on and you can acquire memory, do it before anyone clicks "restart" or "shut down". I have seen a perfectly good case lost because the helpful person on site rebooted to "clear the virus".

#2078 · c0ld_b00t · · Report

All of this. Rubber duck's question goes first, always: question, then collection. And yes, the helpful reboot is its own category of incident.

Log in or join to reply.