2012/11/29

SuperTimeline using log2timeline-sift


사고조사시 중요한 정보 중 하나가 바로 타임라인입니다.
다만, 시스템 여기저기에 흩어져 있는 정보들을 하나하나 수집하면서 타임라인을 작성하는 것은 상당히 귀찮으면서도 혼란스럽습니다. (경험상...)
타임라인 작성에는 log2timeline이라는 툴을 추천해드리며 본 포스팅에서는 SANS SIFT에서 좀 더 보기 좋게(?) 수정한 log2timeline-sift를 소개해드릴까 합니다. 아울러 log2timeline-sift의 결과 파일을 가지고 분석을 위해 정렬을 하였는데 제가 원하는대로 정렬이 되지 않아 log2timeline-sift의 결과 파일을 수정하는 방법에 대해서 말씀드리고자 합니다.


Digital Forensics SIFT'ing: Cheating Timelines with log2timeline
http://computer-forensics.sans.org/blog/2011/12/16/digital-forensics-sifting-cheating-timelines-with-log2timeline

Digital Forensic SIFTing: Colorized Super Timeline Template for Log2timeline Output Files
http://computer-forensics.sans.org/blog/2012/01/25/digital-forensic-sifting-colorized-super-timeline-template-for-log2timeline-output-files


Spluk를 이용한 Supertimeline 작성에 관한 글도 있는데요..
원본과 함께 Forensic Insight 멤버인 도루묵군이 작성한 문서도 소개해드리겠습니다. ;)

Forensic timeline Splunking
http://kleinco.com.au/thoughts-events/item/forensic-timeline-splunking

Forensic Insight Weekly Seminar Slides - Supertimeline+Splunk by dorumugs
http://forensicinsight.org/archives/912


log2timeline을 통해 타임라인 작성시 다음과 같이 csv 파일로 결과를 확인하실 수 있습니다.


보시는 바와 같이 그닥 보기 좋은 형태는 아닙니다.
FileName 컬럼의 데이터들이 분리되어 표시되면 좋을텐데 한꺼번에 들어가 있는 점이나 날짜(Date)가 정렬이 귀찮은 형태로 되어 있습니다. (제가 엑셀 기술이 부족하여 그럴지도 모르겠지만요..)

아무튼 이런한 점을 SANS SIFT에 포함된 log2timeline-sift가 보완해주었습니다.
다음 그림은 log2timeline-sift를 통해 추출한 파일입니다.


다만, log2timeline-sift 실행시 다음과 같은 에러가 발생하였습니다.


root@SIFT-Workstation:/mnt/hgfs/E# log2timeline-sift -p 0 -i win2k3.dd 
[LOG2TIMELINE-SIFT] MFT directly callable, no need for special parsing.
[PreProcessing] Unable to determine the default browser for user qwer
[PreProcessing] Unable to determine the default browser for user networkservice
[PreProcessing] Unable to determine the default browser for user hacker2
[PreProcessing] Unable to determine the default browser for user administrator
[PreProcessing] Unable to determine the default browser for user hacker
[PreProcessing] Unable to determine the default browser for user default user
[PreProcessing] Unable to determine the default browser for user malwarel4b
[PreProcessing] Unable to determine the default browser for user guest
[PreProcessing] Unable to determine the default browser for user localservice
[PreProcessing] Hostname is set to WIN2K3
Wide character in print at /usr/share/perl5/Log2t/PreProc/win_sysinfo.pm line 172.
[PreProcessing] The timezone according to registry is: (대한민국표준시) 대한민국 표준시
[PreProcessing] The timezone settings are NOT overwritten so the settings might have to be adjusted.
[PreProcessing] The default system browser is: : IEXPLORE.EXE ("C:\Program Files\Internet Explorer\iexplore.exe" -nohome)
Local timezone is: Asia/Seoul (KST)
Local timezone is: Asia/Seoul (KST)
Loading output module: csv
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
Wide character in print at /usr/bin/log2timeline-sift line 400.
...(snip)...


해당 에러는 유니코드 처리시 발생되는 에러로 log2timeline-sift의 일부 코드를 수정하면 됩니다.


# create the timeline file // 이부분을 아래와 같이 수정
open( TF, '>' . $store_point . '/' . $file_name . '_bodyfile.txt' ) or die( 'Unable to create the bodyfile ' . $store_point . '/' . $file_name . '_bodyfile.txt, not enough ac    cess rights?');


# create the timeline file // 이렇게...
my $ofile = $store_point . '/' . $file_name . '_bodyfile.txt';
open( TF, ">:utf8", $ofile) or die( 'Unable to create the bodyfile ' . $store_point . '/' . $file_name . '_bodyfile.txt, not enough access rights?');

log2timeline-sift의 결과 파일은 아래와 같은 형태를 띄고 있습니다.

root@SIFT-Workstation:/cases/timeline-output-folder# head win2k3_bodyfile.txt 

date,time,timezone,MACB,source,sourcetype,type,user,host,short,desc,version,filename,inode,notes,format,extra
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$MFT,C:/$MFT,2,C:/$MFT,0, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$MFTMirr,C:/$MFTMirr,2,C:/$MFTMirr,1, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$LogFile,C:/$LogFile,2,C:/$LogFile,2, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$Volume,C:/$Volume,2,C:/$Volume,3, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$AttrDef,C:/$AttrDef,2,C:/$AttrDef,4, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,...B,FILE,NTFS $MFT,$SI [...B] time,-,WIN2K3,C:/.,C:/.,2,C:/.,5, ,Log2t::input::mft,-
04/17/2012,18:07:32,KST,.A..,FILE,NTFS $MFT,$SI [.A..] time,-,WIN2K3,C:/.,C:/.,2,C:/.,5, ,Log2t::input::mft,-
04/17/2012,15:13:02,KST,M.C.,FILE,NTFS $MFT,$SI [M.C.] time,-,WIN2K3,C:/.,C:/.,2,C:/.,5, ,Log2t::input::mft,-
05/14/2009,19:43:54,KST,MACB,FILE,NTFS $MFT,$SI [MACB] time,-,WIN2K3,C:/$Bitmap,C:/$Bitmap,2,C:/$Bitmap,6, ,Log2t::input::mft,-


여기서 한가지 더 해결해야 할 문제는 mm/dd/yyyy 형태의 날짜 형식을  yyyy-mm-dd로 변경하는 것이었습니다. 기본 형태인 mm/dd/yyyy를 가지고 정렬하였더니 시간순서가 원하는대로 나오지 않아 불편하여 변경하게 되었습니다. 방법은 아주 간단합니다.


# sed -n '1p' win2k3_bodyfile.txt > win2k3_bodyfile_convert.csv
# sed -n -e '/KST/ s/\([0-9]*\)\/\([0-9]*\)\/\([0-9]*\)/\3-\1-\2/p;' win2k3_bodyfile.txt >> win2k3_bodyfile_convert.csv



포스팅 초반에 있는 두번째 링크의 Colorized Super Timeline Template를 적용하면 다음과 같이 알록달록하게 나오게 됩니다. (date, time으로 정렬하였습니다)



단순히 보여주기식의 알록달록함이 아니라는 것으 명심하시고 보셔야 합니다.
자칫 그냥 넘어가 버릴 수 있는 중요한 정보들에 대해서 색깔로 구분해서 놓치지 말라는 의미인 것이죠.





댓글 2개:

  1. 오 로그투타임라인 보기만하고 써본적은 없는데, 점점 쓸만해지는게 눈에 보이네요.ㅋㅋ

    답글삭제
  2. 네..좋드라구요..
    근데 디스크 덤프를 떠서 조사하는 경우가 많지 않아서 좀 고민입니다.
    온라인으로 할 수 있는 방법이 있을런지...흠....

    답글삭제