@port139 Blog

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

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

Log2timeline(Plaso)と Ver 0.66 いずれにも含まれているパーサーとしては、レジストリファイルがあります。

Plasoでは WinRegistryParser(Parses Windows NT Registry (REGF) files.)、Ver 0.66 では sam、security、system、software、ntuser が対応したモジュールとなっています。

ここではまず Plaso のレジストリパーサの内容を確認してみます。log2timeline.py --info で Registry Plugins の内容を表示します。解析対象となるハイブによって個別にプラグインが定義されているようですね。

 ******************************* Registry Plugins *******************************

        BootExecutePlugin : Plug-in to collect the BootExecute Value from the

                            Session Manager key.

   BootVerificationPlugin : Plug-in to collect the Boot Verification Key.

           CCleanerPlugin : Gathers the CCleaner Keys for NTUSER hive.

DefaulTerminalServerClientMRUPlugin : Gathers the Default key for the User hive.

            DefaultPlugin : Basic plugin to extract minimal information from

                            registry keys.

LocalDevicesTerminalServerClientMRUPlugin : Gathers the LocalDevices key for the User hive.

            MRUListPlugin : A Registry plugin for keys that contain a MRUList

                            value.

              MRUexPlugin : A simple generic MRU plugin for entries with a

                            MRUListEx.

      MSAccess2010FileMRU : Gathers the MS Access File 2010 MRU keys for the

                            User hive.

     MSAccess2010PlaceMRU : Gathers the MS Access Place 2010 MRU keys for the

                            User hive.

       MSExcel2010FileMRU : Gathers the MS Excel 2010 File MRU keys for the

                            User hive.

      MSExcel2010PlaceMRU : Gathers the MS Excel 2010 Place MRU keys for the

                            User hive.

MSOutlook2010SearchMRUPlugin : Gathers MS Outlook 2010 Data File locations from

                            the User hive.

MSOutlook2013SearchMRUPlugin : Gathers MS Outlook 2013 Data File locations from

                            the User hive.

  MSPowerPoint2010FileMRU : Gathers the MS PowerPoint File 2010 MRU keys for

                            the User hive.

 MSPowerPoint2010PlaceMRU : Gathers the MS PowerPoint Place 2010 MRU keys for

                            the User hive.

        MSWord2010FileMRU : Gathers the MS Word File 2010 MRU keys for the

                            User hive.

       MSWord2010PlaceMRU : Gathers the MS Word Place 2010 MRU keys for the

                            User hive.

      MsieTypedURLsPlugin : Gathers the MSIE TypedURLs key for the User hive.

MsieZoneSettingsSoftwareLockdownZonesPlugin : Parses the Lockdown Zones key in the Software hive.

MsieZoneSettingsSoftwareZonesPlugin : Parses the Zones key in the Software hive.

MsieZoneSettingsUserLockdownZonesPlugin : Parses the Lockdown Zones key in the User hive.

MsieZoneSettingsUserZonesPlugin : Parses the Zones key in the User hive.

MsieZoneSettingsWow64SoftwareLockdownZonesPlugin : Parses the Lockdown Zones key in the Wow6432Node

                            key the Software hive.

MsieZoneSettingsWow64SoftwareZonesPlugin : Parses the Zones key in the Wow6432Node key the

                            Software hive.

RDPDRTerminalServerClientPlugin : Gathers the RDPDR key for the User hive.

          RunNtuserPlugin : Gathers the Run Keys for User hive.

      RunOnceNtuserPlugin : Gathers the RunOnce key for the User hive.

    RunOnceSoftwarePlugin : Gathers the RunOnce key for the Software hive.

RunServicesOnceSoftwarePlugin : Gathers the RunServicesOnce Key for Software hive.

RunServicesSoftwarePlugin : Gathers the RunServices Key for Software hive.

        RunSoftwarePlugin : Gathers the Run Key for Software hive.

ServersTerminalServerClientPlugin : Gathers the Servers key for the User hive.

           ServicesPlugin : Plug-in to format the Services and Drivers keys

                            having Type and Start.

SetupRunOnceSoftwarePlugin : Gathers the RunOnce\Setup key for the Software

                            hive.

         TypedPathsPlugin : Gathers the TypedPaths key for the User hive.

            USBStorPlugin : USBStor key plugin.

        UserAssistPlugin1 : Plugin that parses an UserAssist key.

       UserAssistPlugin10 : Plugin that parses an UserAssist key.

       UserAssistPlugin11 : Plugin that parses an UserAssist key.

        UserAssistPlugin2 : Plugin that parses the Microsoft Internet Toolbar

                            UserAssist key.

        UserAssistPlugin3 : Plugin that parses the ActiveDesktop UserAssist

                            key.

        UserAssistPlugin4 : Plugin that parses an UserAssist key.

        UserAssistPlugin5 : Plugin that parses an UserAssist key.

        UserAssistPlugin6 : Plugin that parses an UserAssist key.

        UserAssistPlugin7 : Plugin that parses an UserAssist key.

        UserAssistPlugin8 : Plugin that parses an UserAssist key.

        UserAssistPlugin9 : Plugin that parses an UserAssist key.

   WinRarArcHistoryPlugin : Gathers WinRAR ArcHistory from the User hive.

      WinRarArcNamePlugin : Gathers WinRAR ArcName from the User hive.

     WinRarExtrPathPlugin : Gathers WinRAR ExtrPath from the User hive.

             WinVerPlugin : Plug-in to collect information about the Windows

                            version.

 Plaso では一括して複数種類のレジストリファイルに対してパースを行ってくれるようですが、まずは NTUSER.DAT だけプロセス対象として指定し結果を確認したいと思います。(サンプルは Windows 7 環境の NTUSER.DAT です)

 root@siftworkstation:/cases# log2timeline.py --parsers WinRegistry --output L2tcsv --logfile out.log -d ntusertimeline.txt /cases/NTUSERDAT/

 実行結果は下記になります。DefaultPlugin によりハイブ内にあるキーの最終更新日時が再帰的に処理されていくようですね。

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

04/20/2014,01:31:50,UTC,..C.,REG,NTUSER key,Last Written,-,-,[\] Value: No values stored in key.,[\] Value: No values stored in key.,2,/cases/NTUSERDAT/NTUSER.DAT,32243714,-,WinRegistryParser,plugin: DefaultPlugin  registry_type: NTUSER 

 日本語文字列が含まれる場合にどうなるかですが、下記のように文字化けが発生するようです。化けている部分は“文書”という文字だった箇所になります。Unicodeで処理してくれれば化けないと思いますが...

 04/19/2014,23:27:13,UTC,..C.,REG,NTUSER key,Last Written,-,-,[\Software\Adobe\Adobe Acrobat\9.0\AVConversionFromPDF\cSettings\c0] sHandler...,[\Software\Adobe\Adobe Acrobat\9.0\AVConversionFromPDF\cSettings\c0] sHandlerUniqueID: [REG_BINARY] tHandlerDescription: [REG_SZ] Microsoft Word 譁・嶌,2,/cases/NTUSERDAT/NTUSER.DAT,32243714,-,WinRegistryParser,plugin: DefaultPlugin  registry_type: NTUSER 

 下記は UserAssistプラグインの結果です。ROT-13 をデコードして出力してくれます。日本語文字列が含まれている場合には、化けてしまい、かつ途中から出力結果が正しく区切られずに出力されてしまうようです。(複数の値が一つのレコードにまとまって出力されてしまうようです)

 04/19/2014,23:24:59,UTC,..C.,REG,NTUSER key,Last Written,-,-,[\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-203...,[\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}] {0139D44E-6AFE-49F2-8690-3DAFCAE6FFB8}\Microsoft Office\Microsoft Office PowerPoint 2007.lnk: REGALERT unsupported value data size: 72.,2,/cases/NTUSERDAT/NTUSER.DAT,32243714,-,WinRegistryParser,plugin: UserAssistPlugin10  regalert: True  registry_type: NTUSER 

 MRU値などをパースしている箇所があると、そこも文字化けしているのではないかと推測されますが、未確認です。

 Log2timeline Ver0.66 同じレジストリファイルをパースした結果どうなるかですが、UserAssistについては日本語部分も化けずに出力してくれるようです。

 04/20/2014,05:28:04,UTC,MACB,REG,UserAssist key,Time of Launch,forensics,-,C:/Users/Public/Desktop/翻訳Studio 2011.lnk,C:/Users/Public/Desktop/翻訳Studio 2011.lnk [Count: 3]  nr. of times app had focus: 0 and duration of focus: 3ms,2,/NTUSER.DAT,32243714,-,Log2t::input::ntuser,-

 しかし、別の部分では以下のように文字化けします。

 04/20/2014,01:19:37,UTC,MACB,REG,RecentDocs key,Folder opened,forensics,-,Recently opened file of extension: Folder - value: ãã­ã¥ã¡ã³ã ,Recently opened file of extension: Folder - value: ãÂÂã­ãÂ¥ã¡ã³ã ,2,/NTUSER.DAT,32243714,-,Log2t::input::ntuser,-

 恐らく内部で使っているプラグインが、Unicodeに対応しているか否かにより、結果に差異が発生していると推測されます。

出力結果を見た時、実際にどのキーまたは値なのか?を確認するには、Plaso の出力結果のほうがキーのフルパスが含まれていて分かりやすい気がしますね。