@port139 Blog

基本的にはデジタル・フォレンジックの技術について取り扱っていますが、記載内容には高確率で誤りが含まれる可能性があります。

Log2timeline.py(Plaso)によるタイムラインの作成(11)

Log2timeline(Plaso)にも、0.66 にも含まれているパーサーとして WinLnkParser があります。いわゆるショートカットファイル(.LNK) をパースしてくれるはずですが、LNK ファイルは内部構造として日本語文字列が含まれている部分もあります。

まずは、Plasoベースの WinLnkParser を使いパース結果がどうなるか見てみます。 

root@siftworkstation:/cases# log2timeline.py --parsers WinLnk --output L2tcsv lnktimeline.txt ./LNK/

 パース結果を確認してみると、一部の日本語文字列について文字化けが発生している事を確認できます。

タイムスタンプのレコードは 3件出力されていますが、これは LNK ファイル内に保持している 3つのタイムスタンプ、Last Access Time と Creation Time、Content Modification Time がそれぞれ出力されています。(ショートカットのターゲットファイルのファイルシステム タイムスタンプ) 

date,time,timezone,MACB,source,sourcetype,type,user,host,short,desc,version,filename,inode,notes,format,extra

04/06/2014,01:07:42,UTC,....,LNK,Windows Shortcut,Last Access Time,-,-,[Empty description] C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ...,[Empty description] File size: 6793 File attribute flags: 0x00000020 Drive type: 3 Drive serial number: 0x04eb6bfd Local path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt Relative path: ..\..\..\..\..\Documents\ペンディングセクタが発生せずエラーになる.txt Working dir: C:\Users\forensics\Documents,2,./LNK/ペンディングセクタが発生せずエラーになる.txt.lnk,27525288,-,WinLnkParser,file_attribute_flags: 32  linked_path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt  drive_serial_number: 82471933 

04/06/2014,01:07:42,UTC,....,LNK,Windows Shortcut,Creation Time,-,-,[Empty description] C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ...,[Empty description] File size: 6793 File attribute flags: 0x00000020 Drive type: 3 Drive serial number: 0x04eb6bfd Local path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt Relative path: ..\..\..\..\..\Documents\ペンディングセクタが発生せずエラーになる.txt Working dir: C:\Users\forensics\Documents,2,./LNK/ペンディングセクタが発生せずエラーになる.txt.lnk,27525288,-,WinLnkParser,file_attribute_flags: 32  linked_path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt  drive_serial_number: 82471933 

04/19/2014,07:23:18,UTC,M...,LNK,Windows Shortcut,Content Modification Time,-,-,[Empty description] C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ...,[Empty description] File size: 6793 File attribute flags: 0x00000020 Drive type: 3 Drive serial number: 0x04eb6bfd Local path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt Relative path: ..\..\..\..\..\Documents\ペンディングセクタが発生せずエラーになる.txt Working dir: C:\Users\forensics\Documents,2,./LNK/ペンディングセクタが発生せずエラーになる.txt.lnk,27525288,-,WinLnkParser,file_attribute_flags: 32  linked_path: C:\Users\forensics\Documents\ƒyƒ“ƒfƒBƒ“ƒOƒZƒNƒ^‚ª”­�¶‚¹‚¸ƒGƒ‰�[‚É‚È‚é.txt  drive_serial_number: 82471933 

 相対パス(Relative path)は化けずに出力されますが、linked_path の方は日本語文字列が化けた出力結果になります。ANSI のデータ部分をパースしている事で文字化けが発生している可能性が推測できますが、相対パスを見ればとりあえずは追いかける事ができそうでしょうか。

 

 次に、Ver 0.66 での出力結果を見てみます。

root@siftworkstation:/cases# log2timeline -f win_link -o csv -r -z UTC -log out.log -w lnktimeline2.csv /cases/LNK/

下記が先ほどと同じLNKファイルから、1レコード分だけ抜粋したものですが、相対パス部分も含め全て日本語文字列部分が化けています。相対パスとファイル名が化けない部分からいけば Plaso で処理する方が良いかもしれません。

04/06/2014,01:07:42,UTC,.A..,LNK,Shortcut LNK,Access,-,-,C:/Users/forensics/Documents/ÂyÂÂÂfÂBÂÂÂOÂZÂNÂ^ª­¶¹¸ÂGÂÂÂ[ÂÃÂÃÂé.txt,C:/Users/hihara/Documents/ÂyÂÂÂfÂBÂÂÂOÂZÂNÂ^ª­¶¹¸ÂGÂÂÂ[ÂÃÂÃÂé.txt <-/cases/LNK//ãã³ãã£ã³ã°ã»ã¯ã¿ãçºçããã¨ã©ã¼ã«ãªã.txt.lnk- which is stored on a local vol type - Fixed- SN 0x4eb6bfd - Rel path: ../../../../../Documents/Ú0ó0Ç0£0ó0°0»0¯0¿0L0zv u[0Z0¨0é0ü0k0j00.txt Working dir: C:/Users/forensics/Documents  [a rel. path str-SI ID exists-working dir.-points to a file or dir] - mod since last backup,2,/ãã³ãã£ã³ã°ã»ã¯ã¿ãçºçããã¨ã©ã¼ã«ãªã.txt.lnk,27525288,-,Log2t::input::win_link,size: 2586