물먹는산세베리아

Windows SetupAPI 로그 파일 자료조사 본문

Project/ing

Windows SetupAPI 로그 파일 자료조사

suntall 2022. 2. 11. 00:05

1. SetupAPI

SetupAPI.dev.log(장치 설치 텍스트 로그)와 SetupAPI.app.log(응용 프로그램 설치 텍스트 로그)에 설치 이벤트에 대한 정보를 기록한다.

 

→ SetupAPI는 이 자체로 로그 파일이 아니라 로그 파일에 정보를 기록하는 프로그래밍 인터페이스이다.

 

Windows XP/2000/2003은 setupapi.log

Windows Vista/7/8/10은 setupAPI.dev.log와 setupapi.app.log로 분할됨

 

* 인터페이스(interface)는 서로 다른 두 개의 시스템, 장치 사이에서 정보나 신호를 주고받는 경우의 접점이나 경계면이다. 

https://better-together.tistory.com/155

2. Text log란?

SetupAPI.dev.log(장치 설치 텍스트 로그)

 

PnP(plug and play) 관리자와 SetupAPI가 SetupAPI.dev.log에 항목을 기록하여 장치 및 드라이버를 설치하는 작업에 대한 정보를 제공한다.

*plug and play는 컴퓨터에 하드웨어 연결 시 별도의 사용자 조작, 프로그램 설치 없이 바로 사용할 수 있는 것을 의미한다.

 

기본적으로 Windows INF 파일 디렉터리(%SystemRoot%\inf )에 있다. → C:\Windows\inf\Setupapi.dev.log

 

▶ 내용

볼륨명, 시리얼넘버, 볼륨 GUID, ProductID, 최초연결 시간, 부팅 이후 최초 연결 시간, 마지막 연결 시간, 마지막 연결 해제 시간, 저장매체를 사용한 사용자 계정

http://www.forensic-artifact.com/windows-forensics/usb

SetupAPI.app.log(응용 프로그램 설치 텍스트 로그)

 

그 이외의 설치 작업에 대한 정보

 

Q. setupapi 로그 내용은 다르지만 포맷은 같을 듯. 로그 별 뷰어 ㄴㄴ 뷰어 하나만 만들면 될 듯? 

3. Text log Format

https://docs.microsoft.com/it-it/windows-hardware/drivers/install/format-of-a-text-log-section

 

Format of a Text Log Section - Windows drivers

Format of a Text Log Section

docs.microsoft.com

https://www.researchgate.net/figure/Generic-USB-setup-information-in-setupapidev-log-file_fig16_337190865

 

Figure 19. Generic USB setup information in setupapi.dev log file.

Download scientific diagram | Generic USB setup information in setupapi.dev log file. from publication: USB Artifact Analysis Using Windows Event Viewer, Registry and File System Logs | A USB mass storage device yields a lot of artifacts when connected to

www.researchgate.net

# Header

운영 체제 및 시스템 아키텍쳐 정보

[Device Install Log]
     OS Version = 6.0.5033
     Service Pack = 0.0
     Suite = 0x0100
     ProductType = 1
     Architecture = x86

[BeginLog]

구조체: OVSERVERSIONINFOEX

호출 함수: GetVersionEx

*참조자료: Microsoft Windows SDK

 

# Section

+ 섹션 머리글: 섹션 열기

+ 섹션 본문: 섹션 작업에 적용되는 로그 항목의 시퀀스를 포함함

+ 섹션 바닥글: 섹션 닫기

>>>  [section_title - instance_identifier]
>>> time_stamp Section start
 section body log entry
 section body log entry
 section body log entry
<<<  [time_stamp: Section end]
<<<  [Exit Status(status_value)]

(추가 예정)

 

4. Enscript - setupapi.dev.log

[ Parse the setupapi.dev.log of USBs ]

https://security.opentext.com/appDetails/Parse-setupapi-dev-log-for-USB-info-v-

 

GuidanceSoftware - App Details

 

security.opentext.com

 

5. 기타

▶ \Windows\INF

▶USB 아티팩트별 경로(윈도우 XP, Vista, 7,8)

http://forensic-proof.com/wp-content/uploads/2012/06/USB-Device-Tracking-Artifacts.pdf

 

6. 관련 코드

▶ setupapi_parser

* parsing은 프로그램을 컴파일하는 과정에서 프로그래밍 언어가 문법이 잘 지켜졌는지 컴파일러가 검사하는 것. '구문분석'

* setupapi parser는 해당 로그 파일을 해석하여 각 요소들의 내용을 분리 및 정리해주는 프로그램이라고 보면 됨. 해당 내용들을 원하는 형식으로 만들어내는 것.

https://github.com/PacktPublishing/Learning-Python-for-Forensics/tree/master/Chapter%203

 

GitHub - PacktPublishing/Learning-Python-for-Forensics: Learning Python for Forensics by Packt Publishing

Learning Python for Forensics by Packt Publishing. Contribute to PacktPublishing/Learning-Python-for-Forensics development by creating an account on GitHub.

github.com

 

7. 해야할 것

setupapi.dev.log 내용 각 섹션 별로 분석해오기 → 이해하기

setupapi_parser.py 코드 구성 이해하기

 

'Project > ing' 카테고리의 다른 글

로그 파일  (0) 2022.01.28