段嚴(yán)兵,羅文華
(中國刑事警察學(xué)院網(wǎng)絡(luò)犯罪偵查系,沈陽 110854)
Windows操作系統(tǒng)環(huán)境下調(diào)查USB設(shè)備使用痕跡方法研究
段嚴(yán)兵,羅文華
(中國刑事警察學(xué)院網(wǎng)絡(luò)犯罪偵查系,沈陽 110854)
獲取送檢介質(zhì)曾經(jīng)掛載的USB設(shè)備使用痕跡,是電子數(shù)據(jù)取證實(shí)踐中典型鑒定需求之一。雖然現(xiàn)有取證工具有的聲稱支持此類信息的分析,但實(shí)際工作中發(fā)現(xiàn)其提取到的痕跡(特別是USB設(shè)備序列號)并不準(zhǔn)確,同時(shí)也不夠全面(如缺少USB設(shè)備被分配的盤符信息),難于滿足取證實(shí)踐的需要。傳統(tǒng)的此類痕跡調(diào)查完全依靠注冊表中的USBSTOR表鍵,為彌補(bǔ)其不足,本文基于電子數(shù)據(jù)取證視角,在詳細(xì)說明USBSTOR表鍵取證關(guān)鍵的基礎(chǔ)上,增加了USB和UMB表鍵的分析;并闡述了在相關(guān)注冊表鍵被清除的情況下,如何依靠系統(tǒng)文件補(bǔ)充調(diào)查USB設(shè)備使用過程中可能留有的痕跡。實(shí)踐證明,所述方法準(zhǔn)確高效。
電子物證;USB設(shè)備;使用痕跡;注冊表;設(shè)備序列號;系統(tǒng)文件
DOΙ: 10.16467/j.1008-3650.2015.02.013
USB是一種外部總線標(biāo)準(zhǔn),Universal Serial BUS(通用串行總線)的英文縮寫,用于電腦與外部設(shè)備的連接和通訊。典型的USB設(shè)備主要包括U盤、移動硬盤、數(shù)碼相機(jī)、掃描儀、圖像設(shè)備、打印機(jī)、鍵盤和鼠標(biāo)等。電子數(shù)據(jù)取證實(shí)踐發(fā)現(xiàn),能夠證明嫌疑人犯罪事實(shí)的關(guān)鍵證據(jù)很多情況下存在于計(jì)算機(jī)主機(jī)掛載過的USB設(shè)備中[1]。因此基于計(jì)算機(jī)主機(jī)調(diào)查USB設(shè)備使用痕跡對于電子證據(jù)相關(guān)性分析,證據(jù)鏈建立,以及擴(kuò)大證據(jù)介質(zhì)來源具有極其重要的實(shí)戰(zhàn)意義。
實(shí)際工作中通常會利用自動獲取工具進(jìn)行USB設(shè)備使用痕跡分析。利用UsbViewer工具抽取出的USB設(shè)備信息,主要包含有設(shè)備名稱、設(shè)備類型、設(shè)備序列號、首次掛載時(shí)間及最近一次掛載時(shí)間等。此類工具完全依賴注冊表進(jìn)行信息收集,在相關(guān)注冊表項(xiàng)被刪除(如UsbViewer即自帶“清除痕跡”功能)的情況下便不具實(shí)戰(zhàn)意義。另外,實(shí)踐發(fā)現(xiàn)基于智能工具分析出的痕跡信息存在不全面與不準(zhǔn)確之處。鑒于此種情況,立足于操作系統(tǒng)整體環(huán)境分析USB設(shè)備使用痕跡的重要作用逐漸凸顯。
1.1 基于注冊表調(diào)查USB設(shè)備使用痕跡
注冊表是USB設(shè)備使用痕跡最主要且最重要的來源。HKLMSYSTEMCurrentControlSetEnum下的USB表鍵使用VID_v(4)&PID_d(4)格式描述USB設(shè)備。其中,v(4)代表4個(gè)數(shù)字的銷售商代碼(由 USB協(xié)會分配給各銷售商);d(4)代表4個(gè)數(shù)字的產(chǎn)品代碼(由銷售商分配給其生產(chǎn)的產(chǎn)品)。從圖1可以看出,某USB設(shè)備的VID為“090c”,PID 為“1000”,其設(shè)備序列號為“AA20091118000001”。USBSTOR表鍵則使用Disk&Ven_iManufacturer&Prod_iProduct& Rev_r(4)格式進(jìn)行描述。iManufacturer表示制造廠商,iProduct表示設(shè)備類型,r(4)則為修正碼。圖2所示即為該設(shè)備的制造廠商為Newsmy,設(shè)備類型為FLSAH_DISK,修正碼為1100,但設(shè)備序列號比USB表鍵多了“&0”兩個(gè)字符。其實(shí),“&0”一類的字符串為系統(tǒng)自動添加,不屬于設(shè)備序列號范疇。UsbViewer工具即基于USBSTOR表鍵進(jìn)行信息抽取,因此獲取到的序列號通常情況下并不完全準(zhǔn)確。值得一提的是,如USB設(shè)備中未包含有序列號信息,Windows則會通過系統(tǒng)自動生成的字符串標(biāo)識該設(shè)備。
圖1 USB表鍵信息Fig.1 USB key information
圖2 USBSTOR表鍵信息Fig.2 USBSTOR key information
從圖1與圖2可以看出,USB表鍵和USBSTOR表鍵均未包含掛載的時(shí)間信息,實(shí)際上此處時(shí)間信息是以屬性形式進(jìn)行存儲的。選擇以序列號為名稱的子鍵,單擊右鍵選擇“導(dǎo)出”,并將“保存類型”選為“文本文件”,打開保存后的文本文件即可獲得時(shí)間信息。還需要指出的是,USBSTOR表鍵下有一名為ParentIdPrefix鍵值,該鍵值數(shù)據(jù)通過關(guān)聯(lián)MountedDevices表鍵可以指示出USB設(shè)備的盤符信息。比如,圖2所示的ParentIdPrefix鍵值數(shù)據(jù)內(nèi)容為“7&3a221764&0”,MountedDevices表鍵下的“DosDevicesI:”鍵值數(shù)據(jù)內(nèi)容中亦出現(xiàn)有“Storage# RemoveableMedia#7&3a221764&0”字樣(圖3),說明該設(shè)備被分配的盤符為I。遺憾的是,MountedDevices表鍵下的信息只會存儲最近一次掛載的ParentIdPrefix鍵值信息,無法追溯盤符分配的歷史記錄。Windows 7注冊表中則不再含有ParentIdPrefix鍵值,而是通過設(shè)備序列號與MountedDevices表鍵關(guān)聯(lián),以確定盤符。
圖3 MountedDevices表鍵信息Fig.3 MountedDevices key information
Windows 7中最新設(shè)置的UMB表鍵為追蹤USB設(shè)備提供了更大的便利[2]。該表項(xiàng)涵蓋了USB和USBSTOR表鍵的重要信息,同時(shí)指示出USB設(shè)備被分配的盤符,彌補(bǔ)了MountedDevices表鍵的不足。從圖4可以看出,序列號為AA20091118000001的USB設(shè)備對應(yīng)盤符為I。需要指出的是,Windows 7 與Windows XP均是在重啟計(jì)算機(jī)之后才會對USB設(shè)備掛載時(shí)間進(jìn)行更新(第一次掛載除外)。
圖4 UMB表鍵下的USB設(shè)備信息Fig.4 USB device information on UMB key
1.2 基于系統(tǒng)文件調(diào)查USB設(shè)備使用痕跡
Windows 7系統(tǒng)分區(qū)下的WindowsinfSetupapi.dev.log文件(Windows XP環(huán)境下則為Windows set upapi.log)包含有關(guān)設(shè)備更換、驅(qū)動程序更改和重要系統(tǒng)修改等數(shù)據(jù)。從圖5可以看出,該文件記載有制造廠商、設(shè)備類型、設(shè)備序列號、首次掛載時(shí)間等詳細(xì)的USB設(shè)備信息?;谠撐募M(jìn)行調(diào)查分析一般可以獲得與注冊表同樣的效果。
圖5 Setupapi.dev.log文件內(nèi)容信息Fig.5 Setupapi.dev.log fi le information
Windows 7事件日志增加了對USB設(shè)備的審核。圖6所示為事件日志中的系統(tǒng)日志記錄有設(shè)備序列號為AA20091118000001的USB設(shè)備卸載要求被拒絕記錄,其事件ID為20011。與USB設(shè)備相關(guān)的事件ID還有20001、20003、24576、24577等。
圖6 Windows 7系統(tǒng)日志中的USB設(shè)備痕跡Fig.6 USB device traces in Windows 7 system logfi le
為了方便計(jì)算機(jī)用戶快速查找最近使用過的文件,Windows操作系統(tǒng)設(shè)置了Recent文件夾,該文件夾默認(rèn)存放路徑為UsersUserNameAppDataRoaming MicrosoftWindowsRecent(Windows XP下則為Docu ments and SettingsUserNameRecent)。Recent文件夾有隱藏屬性,只有在文件夾選項(xiàng)中取消“隱藏受保護(hù)的操作系統(tǒng)文件”后,才能正常查看Recent文件夾。Recent文件夾下存放的實(shí)際是文件(或文件夾及應(yīng)用程序)的快捷方式文件,其擴(kuò)展名為lnk(見圖7)。此類快捷方式文件包含的有目標(biāo)文件屬性及用戶操作信息,這些信息會跟隨用戶行為改變而發(fā)生改變[3]。
圖7 Recent文件夾下存放的快捷方式文件Fig.7 Shortcut fi le in Recent folder
圖8所示為利用WFA(Windows File Analyzer)工具解析出的內(nèi)嵌于快捷方式文件中的目標(biāo)文件信息,主要包括目標(biāo)文件路徑、創(chuàng)建時(shí)間、修改時(shí)間、訪問時(shí)間等。值得一提的是,該工具解析出的時(shí)間信息并未考慮時(shí)區(qū)因素,因此文件“2012級體改生畢業(yè)設(shè)計(jì)選題情況統(tǒng)計(jì)表.xls”的修改時(shí)間才會顯示為“2014/10//30 0:16:34”。實(shí)際工作中需加上8h(東八時(shí)區(qū))才能獲知文件真實(shí)操作時(shí)間。另外,Windows 7為實(shí)現(xiàn)跳轉(zhuǎn)列表功能而設(shè)置了擴(kuò)展名為automaticDestinations-ms的文件(Users\%username% AppDataRoamingMicrosoftWindowsRecentAutomatic Destinations文件夾下),利用此類文件同樣可以分析出與Recent文件夾下快捷方式文件類似的痕跡信息[4]。
圖8 內(nèi)嵌于快捷方式文件中的目標(biāo)文件路徑與時(shí)間屬性Fig.8 Target file path and temporal properties embedded in shortcut fi le
IconCache.db是Windows操作系統(tǒng)用于緩存圖標(biāo)的文件,在Windows 7系統(tǒng)中該文件位于C:Users UsernameAppDataLocal文件夾下(在Windows XP系統(tǒng)中該文件則存放在C:Document and SettingsUsername Local SettingsApplication Data下)。IconCache.db是隱藏文件,需要在文件夾選項(xiàng)中顯示所有文件和文件夾才能正常查看(見圖9)。Windows操作系統(tǒng)利用Icon Cache.db文件緩存圖標(biāo)信息,實(shí)現(xiàn)在特定文件夾下快速展現(xiàn)文件圖標(biāo),以減輕系統(tǒng)重新解析所造成的負(fù)擔(dān)。
圖9 用戶文件夾下的IconCache.db文件Fig.9 ΙconCache.dbuser fi le in user folder
用戶使用Windows系統(tǒng)的過程中,系統(tǒng)會逐漸向IconCache.db文件添加文件圖標(biāo)、文件存儲路徑等信息。當(dāng)用戶把USB存儲設(shè)備連接至計(jì)算機(jī)系統(tǒng)后,如果USB存儲設(shè)備的根目錄下包含可執(zhí)行程序,無論它是否運(yùn)行,其文件名稱、圖標(biāo)、存儲位置、USB設(shè)備盤符等信息就會自動添加至IconCache.db數(shù)據(jù)庫中(見圖10)。此外,如果用戶瀏覽的文件夾含有可執(zhí)行程序,也會自動追加相應(yīng)信息。基于IconCache.db文件分析USB設(shè)備使用痕跡的局限是需要對應(yīng)文件夾下有可執(zhí)行程序,并且只能分析出盤符信息[5]。
圖10 基于IconCache.db獲取USB設(shè)備使用痕跡Fig.1 0 USB device usage traces based on ΙconCache.db
調(diào)查已知USB設(shè)備是否在特定主機(jī)上掛載過或特定主機(jī)掛載過哪些USB設(shè)備是電子數(shù)據(jù)取證工作中常見的鑒定需求。注冊表、Setupapi.dev.log文件及事件日志包含的信息對上述鑒定需求具有直接的重要意義,Recent文件夾、automaticDestinations-ms文件和IconCache.db文件則一般通過USB設(shè)備存放的文件信息輔助間接進(jìn)行證明。另外,當(dāng)部分注冊表表項(xiàng)或系統(tǒng)文件內(nèi)容被刪除時(shí),需針對操作系統(tǒng)整體環(huán)境進(jìn)行深入挖掘才可能關(guān)聯(lián)出USB設(shè)備使用痕跡。
[1] Carvey H.Windows forensic analysis[M].USA: Syngress,2012: 134-156.
[2] 羅文華.Windows環(huán)境下可執(zhí)行文件操作痕跡分析方法研究[J].刑事技術(shù),2013(8): 61-63.
[3] Russinovich M R, Solomon D A.Microsoft windows internals: windows server 2008 and windows vista (5th ed)[M].USA: Microsoft Press, 2009: 246-266.
[4] Barnett A.The forensic value of the Windows 7 jump list[OL].[2012].http://www.alexbarnett.com/jumplist-forensics.pdf.
[5] Dolan-Gavitt B.The windows IconCache.db: a resource for forensic artifacts from USB connectable devices[J].Digital Investigation, 2013(9): 200-210.
引用本文格式:段嚴(yán)兵,羅文華.Windows操作系統(tǒng)環(huán)境下調(diào)查USB設(shè)備使用痕跡方法研究[J].刑事技術(shù),2015,40(2):138-141.
USB Device Usage Traces in Windows Environment
DUAN Yan-bing, LUO Wen-hua
(Department of Network Criminal Ιnvestigation, National Police University of China, Shenyang 110854, China)
Ιn the practice of digital forensics, the key evidence to prove the criminal facts mostly exists in the mounted USB devices.To obtain the usage traces of inspecting USB devices ever being mounted is a typical identification requirement of digital forensics.There are some existing forensic tools that support the analysis of such information.However, extracting traces in actual work is not accurate (especially USB device serial number) and not complete (such as lacking the information of USB drive letter).Ιt is diffi cult to meet the need of forensic practice.Ιn order to make up for defi ciencies, this paper investigates USB devices usage traces from two aspects based on the perspective of the electronic data forensics.One is using the registry to inspect USB devices usage traces.The registry is the main and important source of USB devices usage traces.This paper describes the forensics of USB key and USBSTOR key in detail, and gives the extracting method of temporal information and correlation method with MountedDevices key.Ιt also provides the analysis of UMB key that is the new increase of Windows 7 system.UMB key covers the important information for USB key and USBSTOR key, which indicates the information of USB drive letter and makes up for the defect of MountedDevices key.The other aspect is using the system fi les to inspect USB devices usage traces.This also has direct signifi cance for meeting forensic requirements.Setupapi.dev.log fi le in Windows 7 system partition contains the data about the equipment replacement, the driver change and the important system modifi cation.The investigation and analysis of Setupapi.dev.log fi le usually obtains the same effect as that of registry.The system log in Windows 7 event log increases the audit to USB devices.Ιt records the unloading information of USB devices.The shortcut fi les in Recent folder contain the target fi le attributes and users’ operation information, which can change with user behaviors.Using WFA tool and Windows 7 fi les with extension automaticDestinations-ms can resolve the target fi le information of the shortcut fi les in the Recent folder.ΙconCache.db is the icon cache fi le for windows system.Users’ behaviors using Windows system can gradually add to the ΙconCache.db fi le, including the information of fi le icon, storage path and so on.Using ΙconCache.db fi le also can analyze the usage traces of USB devices.When users connect USB storage devices to computer system, the information will be added to the ΙconCache.db database if the root directory contains executable program.Ιn addition, this paper expounds how to rely on the system fi les to make a supplementary investigation of USB usage traces in the case of the relevant registry keys being cleared.Proved by practice, the method is accurate and effi cient.
digital forensics; USB devices; usage traces; registry; device serial number; system fi les
DF793.2
A
1008-3650(2015)02-0138-04
段嚴(yán)兵(1973—),女,遼寧沈陽人,副教授,博士,研究方向?yàn)榫W(wǎng)絡(luò)安全、電子物證。 E-mail:yanbing.duan@163.com
2013-11-18