toc

1. Investigation

Actions

2. Computer forensics

Flagrante delicto
A "flagrante delicto" (caught whilst doing a crime) situation is the ideal for every security office, be it in the physical or in the electronic world.

Often good monitoring, logging, and data capture systems can provide all the info necessary for a catch or at least give a good contextualisation of the scene, for this snort, tripwire, and consorts are your friends, however this isn't implemented much nor very well. Except in dedicated Honeynets.

Computer systems are huge and complex, changing very rapidly and even on well monitored environments things can hide, alarms can be miss leading, etc. The grab to the forensics analysis tools is quasi inevitable.

Definition
Computer forensics is the "art" of gathering and analysing data from a computer crime-scene, in a manner as free from distortion or bias as possible, to determine and reconstruct what has happened on the system.

The key-factors from this definition, to be kept in mind by every digital-detective, are:

2.1. Trust is your enemy

and other lemmas :

2.2. The battle plan

To establish the context it's always good to start with questions:

2.3. Facing the scene

he analysis of the crime-scene or "situation" must be handled with great care. A fixed and precise procedure has to be followed :

  1. Secure and isolate

    This first step is somehow converse. Should the network cable be immediately plugged out, or not ? Experts minds are split on this.

  2. Record the scene

    Respect the order of volatility of data storage.

  3. Conduct a systematic search of evidence

    Think, define goals, targets (based on logs etc. of unaffected systems). Assume the worst, but move carefully and most important log (write down) every action.

  4. Collect and package evidence

    Spot and get data that can be used as evidence, by correlating various redundant sources, to be able to draw coherent conclusions.

  5. Maintain chain of custody

    Keep the parent-child persistence and reconstruct the time line.

2.4. Prepare for the battle

To get a system to an "absolute zero" point (where you could capture all the data in it's original state) is impossible. Think about Schroedinger's cat.

Dan Farmer's prime directive : Strive to capture as accurate a representation of the system(s), as free from distortion and bias as possible.

2.5. Documentation and planning

Planning and documenting all the actions during a forensics analysis is paramount, cause sometimes you only have one chance to get an info or respond correctly, especially when working on a hot (on-line) victim.

Time Command line Trusted md5 Comments
09/03/2006 10:32:15 ` dd < /dev/mem > mem.dd ` Y 689d65e975835...
09/03/2006 10:38:27 ` lsof > of.t ` Y 0c2e968f85600d...
09/03/2006 10:43:14 ` lsof > of.u ` N 4abec5436ca13d...

2.6. Data capture

Respect the order of volatility:

  1. Registers, peripheral memory,
  2. Memory (kernel, physical)
  3. Network state
  4. Running processes
  5. Disk
  6. Floppies, backup media, etc.
  7. CD-ROMs, printouts, etc.

2.6.1. Volatile data first

More tips:

2.6.2. Non-volatile data

A simple backup is not enough, one has to make an identical copy of the filesystem to a secure location. Deleted files are also needed, again dd comes in handy.

Setup up a server on a trusted machine where data should be send to and collected, the netcat tool is ideal for this :

[coroner] netcat -l -p 6969 > hda.dd

Copying the whole disk to the coroner machine using dd and net(crypt)cat :

[victim] dd if=/dev/hda | netcat coroner 6969

It is good advice to copy the whole disk not only the partitions (swap is easily forgotten, data may reside on unpartitioned areas). To get partitions separated again (cause many tools only work properly with partitions not disks) :

fdisk -lu hda.dd

to get start and end cycles

dd if=hda.dd of=hda1.dd bs=512 skip=63 count=192717

to reconstruct the partition

Another solution can be to use the loopback device-driver, so one doesn't need to split partitions up again.

2.7. Exploring the abyss

Now that the volatile and non-volatile data sources were all securely copied to a trusted host the real analysis can begin. Some examples...

2.8. Collect the evidence

Continuously write down every scrap of unusual happening and try to correlate things together to slowly reconstruct the whole scene and find the modus operandi of the offender. An example of such a scene description is shown in Annex A.

3. The other side of the medal

Who would have thought that IT staff would become the "network cops" ? This simple question nicely defines the scope of the conclusion, because it is indeed not so simple. The legal aspect, especially in the electronic world is becoming more and more important and every of the preceding steps could change the "network cops" to "data spies" or "privacy breakers" etc.

Another issue showing how far computer forensics is still away from the prestige that regular forensics has been granted in our society, is business continuity (e.g. BASEL 2).

Even if computer forensics did evolve nicely in the last years and can in fact reconstruct whole crime-scenes and collect legally valid (hopefully) evidences, keep in mind that developing secure software is at the basis of the "trust chain" contributing far more to the whole IT security system then any attempt to "heal" systems or analyse post-mortem situtations.

Annex A

Example intrusion report

pdf version