pst.libre.lu

computer forensics
15/01/2005

toc

1. 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, for this snort, tripwire, and consorts are your friends, however this isn't implemented much nor very well. Except in dedicated Honeynets.

Another more important issue is the legal aspect, in Europe there are relatively high privacy and data protection requirements, that for instance doesn't allow to watch employees activities.

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

2. Definition

A 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:

3. Trust is your enemy

and other lemmas :

4. The battle plan

4.1. Questions to be answered

4.2. Facing the scene

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

5. Elementary my dear Watson

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.

5.1. Prepare for the battle

If you can't trust the system how can you use the system's tools (even a simple ls could be corrupt) to explore it ? Trust only your tools, or coming from a trustworthy source. For instance statically linked binaries on a CD or other write-protected media. There are some really nice live-CD collections out there, e.g. Auditor from http://www.remote-exploit.org.

Off-line or on-line ? Maybe a hybrid solution is an answer ?

First collect, analyse later! Best is to prepare a secure and trusted machine to collect all the data, for later analysis. Let's call this machine coroner :

[coroner] cryptcat -k key -l -p 6969 > victim.data

5.2. 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.

A simple table similar to the following example can already be very useful :

Time Command line Trusted Untrusted md5sum of data capture Comments
15/01/2005 10:32:15 ` dd < /dev/mem | cryptcat -w 3 key coroner 6969 ` X 689d65e97dad5b8d1a35b3600c3f7b8e
15/01/2005 10:38:27 ` lsof | cryptcat -w 3 key coroner 6969 ` X 0c2e968f85600d3f33bec5433ca13d04

Doing checksums of all transferred data for later consistency is also very important.

Identical trusted/untrusted execution can be useful to check if the offender did really modify things.

5.3. Volatile data capture

The following listings are ment as illustrative examples and not exhaustive nor real situation

5.4. Not simply a backup

Make an identical copy of the filesystem to a secure location. A simple backup (tar czvf ...) isn't sufficient. Deleted files are also needed, again dd comes in handy.

Copying the whole disk to the coroner machine using dd and cryptcat :

[victim] dd id=/dev/hdc | cryptcat -w 2 -k key 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 in separate files again :

fdisk -lu hdc.dd

to get start and end cycles

dd if=hdc.dd of=hdc1.dd bs=512 skip=52 count=115119933

to reconstruct the partition

Another solution can be to use the loopback device-driver.

5.5. Exploring the abyss

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

Tools like ils and icat can find and recover deleted files:

# ils -f fs_type -r hdc1.dd

class|host|device|start_time
ils|victim|hdc1.dd|1105737210
st_ino|st_alloc|st_uid|st_gid|st_mtime|st_atime|st_ctime|st_dtime|st_mode|st_nlink|st_size|st_block0|st_block1
1|a|0|0|1083155632|1083155632|1083155632|0|0|0|0|0|0
30|f|0|0|1075854534|1095519879|1100866281|1100866281|100644|0|548534|2175|2176
31|f|0|0|1083164314|1100866270|1100866282|1100866282|120777|0|18|0|0
32|f|0|0|1075854533|1095519879|1100866282|1100866282|100644|0|933609|2715|2716
33|f|0|0|1083165336|1095519879|1100866282|1100866282|100644|0|149312|3632|3633
34|f|0|0|1083165337|1095519879|1100866282|1100866282|100644|0|512|3779|0
35|f|0|0|1100281361|1100300830|1100866282|1100866282|100644|0|34756|7666|7667
36|f|0|0|1087888466|1100705246|1100866282|1100866282|100644|0|1493636|4710|4711

# icat hdc1.dd 35 > file

5.6. 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.

6. 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

A post-mortem intrusion analysis from Wietse Venema : http://www.porcupine.org/forensics/intrusion-report.ps

bibliography

pdf version