c0msherl0ck.github.io

https://www.cfreds.nist.gov/data_leakage_case/data-leakage-case.html

http://forensic-proof.com/archives/3632 "윈도우에서 USB 흔적 추적하기 (USB Device Tracking on Windows)"

http://forensic-proof.com/archives/276 "마운트된 장치 GUID 분석하기 (Mounted Devices GUID Analysis)"

http://forensic-proof.com/archives/5945 "윈도우 7 장치 연결/해제 이벤트 로그 (Windows 7 Device Tracking Event Log)"

https://docs.microsoft.com/ko-kr/windows-hardware/drivers/install/hklm-system-currentcontrolset-control-registry-tree

https://www.blackbagtech.com/blog/2017/02/14/analyzing-usb-entries-in-windows-7/

https://www.forensicswiki.org/wiki/USB_History_Viewing

http://orionforensics.com/w_en_page/USB_forensic_tracker.php "USB Forensic Tracker"


#22. List external storage devices attached to PC.


1. SetupAPI 로그 분석(setupapi.dev.log) 을 통한 최초 장치 연결 시각

2. 레지스트리 분석

3. 이벤트 로그 분석을 통한 연결 해제 시각

4. USB Forensic Tracker를 통한 분석


1. SetupAPI 로그 분석(setupapi.dev.log)


Windows 2000/XP : %SystemRoot%\Setupapi.log

Windows Vista/7/8 : %SystemRoot%\inf\Setupapi.dev.log


가. 위 경로의 파일을 recover/copy 한다.


나. log 파일을 확인하면 다음과 같이, device 가 연결되었을 때의 "드라이버 설치과정"이 기록되어 있다. "최초 연결 시각"을 알 수 있다.

It should be noted that the dates and times listed in this log are in local time

(using the offset applied to the computer at the time of entry).  

즉, 기록되는 시간값이 분석대상 PC의 timezone이 적용된 local time 으로 기록된다.



setupapi.dev.log


2. 레지스트리 분석


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR

HKLM\SYSTEM\MountedDevices

HKU\{USER}\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmt\{Device Entry}

HKLM\SOFTWARE\Microsoft\Windows Portable Devices\Devices\{Device Entry}

HKLM\SYSTEM\ControlSet00#\Control\DeviceClasses\{숫자}\{Sub Keys}


가. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR

This registry entry tracks USB storage devices that have been connected to the computer.  This is where Windows will record the manufacturer information along with the serial number as read from the device.


USB의 serial numberFirst connection time 을 알 수 있다.


나. HKLM\SYSTEM\MountedDevices


"MBR이 존재하는 디스크의 경우 사용자가 특별하게 해당 레지스트리 값을 지우지 않는다면 MountedDevice에 GUID 값이 저장된다. 각 값의 데이터에는 12바이트의 값이나 12바이트 이상의 값들이 존재한다. 12바이트의 문자는 MBR의 정보(디스크 시그니처 + 볼륨시작위치)를 이용해 생성하지만 그보다 긴 값들을 운영체제가 임의로(미리 정의된 형식) 생성한다. Data 값이 동일하고 Value Name 부분만 다른 케이스들을 확인 할 수 있는데, Volume GUID, 드라이브 문자 2가지로 표현한 것이며 동일한 장치를 의미한다."


위의 그림에서는 Data 값이 같은 것끼리 묶었을 때 총 6개가 확인가능하며 Data 크기에 따라 다음과 같이 해석한다.


1) Data 크기가 12 bytes 인 경우의 해석 (USB Drive Enclosure, 내장/외장 하드 디스크)

12 bytes = Disk signature (4 bytes) + volume start address (8 bytes)


1.1) \??\Volume{c9a1c040-d2d7-11e4-9dae-806e6f6e6963} / \DosDevices\C: / \??\Volume{c9a1c041-d2d7-11e4-9dae-806e6f6e6963}

위 그림의 위에서부터 3가지 항목의 Disk signature 가 20-57-26-F0 동일하므로 같은 로컬 고정 디스크이며,

시작위치정보는 각각 Little Endian 으로, 00-00-10-00-00-00-00-00, 00-00-50-06-00-00-00-00 이다.


MBR partition table 에서 확인해보면 다음과 같이 일치하는 것을 알 수 있다.

- Disk signature : 20 57 26 F0

- partition 1 시작위치 : 0x800 * 0x200(512bytes) = 0x100000

- partition 2 시작위치 : 0x32800 * 0x200(512bytes) = 0x6500000



1.2) \DosDevices\E: / \??\Volume{a2f2048e-d228-11e4-b630-000c29ff2429}

Disk Signature : 4C 03 21 E2

1.3) \??\Volume{662626a6-d181-11e4-9591-000c29ff2429}

Disk Signature : D8 03 21 E2


2) Data 크기가 12 bytes 이상인 경우의 해석 (USB Thumbdrive, CD, DVD)

Data 를 Unicode로 디코딩한다.

2.1) \DosDevices\A: / \??\Volume{c9a1c045-d2d7-11e4-9dae-806e6f6e6963}
interpreted data : \??\FDC#GENERIC_FLOPPY_DRIVE#6&3b4c39bd&0&0#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
# 을 구분자로 한다.
- Device Class Identifier : GENERIC_FLOPPY_DRIVE
- Serial Number : 6&3b4c39bd&0&0
- Volume Label : 추가적인 정보가 없다.
- Volume Serial Number : 추가적인 정보가 없다.

2.2) \DosDevices\D: / \??\Volume{c9a1c044-d2d7-11e4-9dae-806e6f6e6963}
interpreted data : \??\IDE#CdRomNECVMWar_VMware_SATA_CD01_______________1.00____#6&373888b8&0&1.0.0#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
# 을 구분자로 한다.
- Device Class Identifier : CdRomNECVMWar_VMware_SATA_CD01_______________1.00____
- Serial Number : 6&373888b8&0&1.0.0
- Volume Label : 추가적인 정보가 없다.
- Volume Serial Number : 추가적인 정보가 없다.

다. HKU\{USER}\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2

계정별 마운트된 저장장치의 GUID 값을 확인할 수 있다.

즉, 해당계정의 사용자가 해당 장치를 마운트 한 것이다.


The Last Write Time listed is the last time this device was connected (by that user).

해당 키의 수정 시각이 "마지막 연결 시각", Last connection time


1) informant

##10.11.11.128#secured_drive

\??\Volume{662626a6-d181-11e4-9591-000c29ff2429}  Disk Signature : D8 03 21 E2

\DosDevices\E: / \??\Volume{a2f2048e-d228-11e4-b630-000c29ff2429}  Disk Signature : 4C 03 21 E2

\DosDevices\C: / \??\Volume{c9a1c041-d2d7-11e4-9dae-806e6f6e6963}

\DosDevices\D: / \??\Volume{c9a1c044-d2d7-11e4-9dae-806e6f6e6963} CD-ROM


2) admin11

\DosDevices\C: / \??\Volume{c9a1c041-d2d7-11e4-9dae-806e6f6e6963}

\DosDevices\D: / \??\Volume{c9a1c044-d2d7-11e4-9dae-806e6f6e6963} CD-ROM


3) temporary

\DosDevices\C: / \??\Volume{c9a1c041-d2d7-11e4-9dae-806e6f6e6963}

\DosDevices\D: / \??\Volume{c9a1c044-d2d7-11e4-9dae-806e6f6e6963} CD-ROM


위의 결과로 볼때, informant 계정의 사용자가 C: D: 기본 드라이브 이외에, 2개의 저장장치를 추가적으로 연결하였음을 알 수 있다.


라. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmt\{Device Entry}

Volume label 을 확인할 수 있다.



마. HKLM\SOFTWARE\Microsoft\Windows Portable Devices\Devices\{Device Entry}

아래와 같이 정보가 없다.



바. HKLM\SYSTEM\ControlSet001\Control\DeviceClasses\{숫자}\{Sub Keys}

해당 키의 수정 시각이 "부팅 후 최초 연결 시각"이다. First Connection Time After Booting

아래의 그림은 하위키 중 USB, storage, CD-ROM 해당하는 부분을 확인한 것이다.





3. 이벤트 로그 분석


장치가 연결 해제되면 관련 정보를 이벤트 로그에 기록한다.

%SystemRoot%\System32\winevt\Logs\Microsoft-Windows-DriverFrameworks-UserMode%4Operational.evtx

해당 이벤트 로그를 분석하면, "마지막 연결 시각"을 알 수 있다. Last Connection Time


Security Log Audit Plug and Play Activity

6416: A new external device was recognized by the System.

6419: A request was made to disable a device.

6420: A device was disabled.

6421: A request was made to enable a device.

6422: A device was enabled.

6423: The installation of this device is forbidden by system policy.

6424: The installation of this device was allowed, after having previously been forbidden by policy.

Microsoft-Windows-Partition/Diagnostic

1006: May contain Manufacturer, Model, Serial, and raw Partition Table, MFT, and VBR data.


분석 대상 PC 에는 해당 이벤트 로그가 기록이 되어 있지 않다. 혐의자가 안티포렌식 행위를 한 것으로 보여진다.


일반적으로 다음과 같이 로그가 남겨진다.


4. USB Forensic Tracker v1.1.1 를 통한 분석


가. 프로그램 실행 후, Mount Forensic Image 를 클릭한다.



나. Mount E01 Image 를 클릭한다.



다. E01 image 를 클릭한다.



라. Write temporary 옵션을 선택한다.



마. 마운트된 드라이브 문자를 확인한다.



바. 해당 드라이브 문자를 선택 한 후, Run 한다.



사. 다음과 같이 1. 2. 3. 에서 했던 결과물들을 간편히 확인할 수 있다.