목차
- 1. 개요
- 2. 소개
- 3. Windows Server 2008 R2 기준점 생성과 유효성 검사
- 3.1. 데이터 수집 접근법
- 3.2. 초기 기준점 구축
- 3.3. 일반적인 윈도우 서버 2008 R2에 대한 기본점 테스트
- 3.4. 연결된 윈도우 서버 2008 R2 부속 도메인에 대한 기준점 테스트
- 4. 결론
- 5. 참고 자료
1. 개요
이 문서는 볼라티리티(Volatility)를 이용한 메모리 분석에서 악성코드를 찾기 위한 방법 중 하나로, 화이트리스트 기반으로 메모리 이미지를 구성하고 변경사항을 찾는 방법으로 메모리의 기준점(Baseline)을 구성하기 위한 내용이다. 아직 기준점 구성을 해보지 않았지만, SANS에서 잘 정리된 문서가 있어 이를 번역했다. 참고로 이 문서는 2014년에 작성되어 있기에 최신 볼라티리티 버전과 상이하여 실습에 문제가 발생할 우려가 있다.
2. 소개
SANS의 고급 포렌식 분석과 침해사고 과정(Lee & Tilbury, 2013)은 침해 지표 확인을 위한 메모리 검사 프로세스를 정의한다. 불량 프로세스 식별, 프로세스 객체 분석, 네트워크 아티팩트 검토, 코드 삽입의 증거 찾기, 루트킷의 흔적 확인 그리고 의심스러운 프로세스와 드라이버를 덤프하는 총 6 단계로 구성된다.
분석가는 불량 프로세스를 식별과 함께 실행중인 프로세스, 부모 프로세스 그리고 시작 지점을 확인한다. 다음과 같은 질문을 생각하며 확인해보자.
- 프로세스가 있어야만 하나요?
- 부모 프로세스는 무엇이며 예상되는 동작은 무엇인가요?
- 운영체제가 시작할 때 프로세스가 함께 시작하나요?
프로세스 객체를 분석할 때 분석가는 실행 파일의 이름, 실행 파일의 경로, 프로세스 시작에 사용되는 커맨드라인 매개변수 그리고 이와 관련된 보안 식별자를 검사한다. 다음과 같은 질문을 생각하며 검사한다.
- 실행 파일이 예상했던 디렉터리에서 시작했나요?
- 커맨드라인 매개변수는 예상할 수 있는 매개 변수인가요?
- 프로세스가 실행되는 상황은 예상했는가요?
- 이러한 실행은 시스템 권한으로 실행되었나요?
- 아니면 사용자로 실행되었나?
분석가는 메모리에 로드된 동적 링크 라이브러리(DLL)와 커널 모듈로 볼 수 있다.
그런 다음 분석가는 estableshed로 연결된 네트워크와 이를 처리하는 프로세스를 검사한다.
- 비정상적인 네트워크 연결이 있나요?
- 프로세스와 관련된 네트워크 연결이 시작되었나요?
다음과 같은 의문을 가지고 위 세가지에서 공통적으로 이상한점을 찾는다.
- 어떤 것이 비정상적이다는 것을 알 수 있을까?
- 자문자답을 위해, 추측하는 것을 어떻게 알 수 있을까?
문헌과 웹을 통한 검색은 출발지점만 제공받을 수 있다. 한 가지 해결책은 예상되는 것의 기준점을 수립하고, 이 기준점에 부합하는지 알아보는 것이다. 이러한 기준선을 사용하여 예상되는 프로세스를 필터링하여 예상하지 못한 부분에 집중할 수 있다.
이 문서는 다음과 같은 책을 참고하여 기준점을 수립하는데서 시작한다.
- Windows Internals, 6th Edition Part 1, 2 (Russinovich, Solomon & Ionescu, 2012a, 2012b)
- Know your Windows Processes or Die Trying (Olsen, 2014)
- The Art of Memory Forensics (Ligh, Case, Levy, and Walters, 2014)
그런 다음 일련의 Windows 2008 R2 서버의 기준점을 테스트하여 유효성을 검사하고 수정한다.
3. Windows Server 2008 R2 기준점 생성과 유효성 검사
3.1. 데이터 수집 접근법
3.1.1. 메모리 확보
메모리 분석은 메모리 이미지를 확보하는 것에서 시작한다. 메모리를 확보하는데 사용할 수 있는 여러 도구가 있다. 여기서는 MoonSols의 win66dd.exe를 사용한다. 가장 좋은 방법은 수집 프로세스가 분석중인 시스템에 미치는 영향을 최소화하기 위해 외부 장치를 이용하여 메모리 이미지를 수집하는 것이다. 조사 대상 시스템의 디스크에 이미지를 생성하면 중요한 데이터를 덮어쓰거나 잃을 수 있다. 수집되는 메모리의 양을 감안할 때 기가 바이트 이상의 데이터에 해당할 수 있다. 이 문서의 분석은 디스크 내용이 아닌 메모리 이미지에만 관심이 있으므로 서버의 하드 드라이브에 있는 c:\tmp 디렉터리에서 win66dd.exe를 실행하여 메모리를 확보한다.
3.1.2. 메모리 분석
메모리 이미지를 분석하는데 사용할 수 있는 여러 도구가 있다. 이 문서에서는 파이썬으로 작성된 오픈소스 메모리 분석 프레임워크인 볼라티리티(Volatility Wiki, 2013)를 선택했다. 볼라티리티는 윈도우 XP 서비스팩 2 메모리 이미지(Volatility Wiki, 2013)를 분석하는 것을 제외하고, 명령을 실행 할 때 메모리 이미지 형식을 정의해야 한다. 분석에 사용된 형식인 Win2008R2SP1x64는 vol.py -f mem.img imageinfo 명령을 실행하여 정의한다. 여기서 mem.img는 분석하려는 이미지 파일의 이름이다. 모든 볼라티리 명령에 이미지 형식을 포함하는 대신 다음과 같이 VOLATILITY_PROFILE를 환경변수에 설정하여 사용할 수 있다.
export VOLATILITY_PROFILE=Win2008R2SP1x64
3.1.3. 서버 설치
Windows Server 2008 R2는 Vmware Tools를 설치한 VMware Workstation 9.0에 설치했다. Windows의 모든 변형은 하나의 설치 ISO 이미지로부터 설치했다. systeminfo | find "OS" 명령을 사용하여 Windows Server 2008 R2 버전이 6.1.760 서비스팩 1 빌드 7601인 것을 알 수 있다. 운영체제 업데이트는 적용하지 않았다.
3.2. 초기 기준점 구축
메모리에서 프로세서의 기준점을 구성하기 위한 시작은 부팅할 때 운영체제가 로드하는 핵심 프로세스와 사용자가 로그인할 때 로그되는 프로세스에 대한 기본적인 이해가 필요하다. 이는 Windows Internals 6th Part 1, 2 (Russinovich, Solomon & Ionescu, 2012a, 2012b)에서 자세히 설명되어 있다. 중요한 윈도우 프로세스의 요약은 The Art of Memory Forensics (Ligh, Case, Levy, and Walters, 2014), Windows Processes or Die Trying (Olsen, 2014) literature 뿐만 아니라 SANS DFIR Digital Forensics and Incident Response Poster (Pilkington & Lee, 2014) 문서에서 찾을 수 있다.
메모리에서 프로세스 목록에 나타나는 첫 번째 프로세스는 시스템이다. 시스템은 커널 프로세서를 위한 컨테이너다. (Ligh, Case, Levy 그리고 Walters, 2014) 정적 프로세스 ID가 4이고 부모 프로세스는 없다. 시스템이 세션 관리자(smss.exe)를 시작한다. (Olsen, 2014)
smss.exe는 부팅 시퀀스의 첫 번째 사용자 모드 프로세스다. 세션 생성과 관련있다. 부팅 시 두 개의 세션이 생성된다. 세션 0은 시스템과 윈도우 서비스가 소유한 프로세스를 포함한다. 세션 2는 사용자가 소유한 프로세스를 포함(Ligh, Case, Levy 그리고 Walters, 2014)한다. smss.exe는 각 세션에 대해 클라이언트/서버 런타임 하위 시스템(csrss.exe)을 복사하는데서 시작한다. 윈도우 초기화 프로세스 (wininit.exe)를 시작하여 세션 0을 초기화하고 윈도우 로그온 프로세스(winlogon.exe)를 시작하여 사용자 세션을 초기화한다. 각 사용자 로그온에는 로그온할 때 만들어지는 고유한 세션 ID가 있다. 새 세션을 만들 때, smss.exe는 자체적으로 세션을 초기화하고 종료하는 자식 인스턴스를 만든다. 이러한 이유로, csrss.exe, wininit.exe 그리고 winlogon.exe의 부모 프로세스 아이디(PPID)는 메모리에 있는 프로세스(Pikington & Lee, 2014)의 프로세스 ID (PID)로 다시 매핑되지 않는다.
Wininit.exe는 세션 0에서 실행되는 사용자 모드 초기화 프로세스를 수행한다. 여기에는 로컬 보안 기관 (lsass.exe), 세션 관리자 서비스 로드(lsm.exe), 그리고 시스템 제어 관리자(service.exe)가 포함된다. lsass.exe는 로컬 보안 정책을 담당한다. lsm.exe는 새 세션을 시작할 때 smss.exe를 호출하여 터미널 서버 세션을 관리한다. (Olsen, 2014)
윈도우는 대부분의 운영체제처럼 대화형 사용자와 관련없는 프로세스가 있다. 대신 사용자 로그온과 독립적으로 실행된다. 이들은 서비스라고 부르고, services.exe에 의해 실행된다. 윈도우는 각 서비스를 자체 프로세스로 실행하지 않는다. 대신 서비스를 공통적인 특성과 함께 서비스 그룹으로 그룹화한다. 이러한 서비스 그룹은 svchost.exe라는 일반 프로세스를 사용하여 시작된다. 여러 svchost.exe가 메모리에서 실행되는 것을 볼 수 있다. svchost.exe는 실행될 서비스 그룹을 지정하는 -k 매개 변수와 함께 시작된다. 표 1에 나열된 내용은 Windows Internals Part 1 (Russinovich, Solomon & Ionescu, 2012a)에 정의된 주요 시스템 그룹으로 초기 기준점을 채운다.
윈도우 부팅 프로세스에 대한 설명에서 볼 수 있듯이 프로세스 메모리 분석을 위한 초기 기준점을 구축할 수 있다. 표 2는 메모리 덤프에서 찾을 수 있는 세션 0에 관한 프로세스를 요약한다.
대화형 로그온 프로세스의 책임은 Winlogon.exe가 가진다. 이는 LoginUI.exe 프로세스 실행으로 사용자 로그온 상호 작용, 암호 변경 그리고 워크스테이션 잠금과 해제를 관리한다. (Russinovich, Solomon & Ionescu, 2012a). 사용자가 성공적으로 인증되면 레지스트리 값 HKLM\SOFTWARE\Microsoft\Windows NT\Current Version\Winlogon\shell에 정의된 쉘 프로세스가 시작된다. 기본 쉘 프로세스는 Explorer.exe다. 이는 Userinit 프로세스에 의해 시작되고, explorer.exe가 시작되면 끝난다. 따라서, 부모 프로세스 실행을 찾을 수 없다. 원격 데스크톱을 통해 로그인한 사용자의 경우, 콘솔이 아닌 사용자의 세션과 관련된 rdpclip.exe 프로세스가 메모리에서 발견된다.
사용자 세션은 다음과 같은 세 가지 상태를 가진다.
사용자가 로그인되어 있지 않다
사용자가 콘솔로 로그인되어 있다
사용자가 원격으로 로그인 되어 있다
표 3은 이러한 각각의 상태에서 볼 수 있는 프로세스를 보여준다. 이는 사용자 로그온 프로세스를 위한 기초 기준점을 구성한다. 부모 프로세스의 종류가 등재되지 않기에 PPID는 메모리에서 프로세스로 다시 추적하지 않는다. 사용자 세션이 세션 1, 세션 2 등 될 수 있기 때문에 모든 세션을 사용자 세션으로 참조한다.
프로세스뿐만 아니라 메모리 포렌식에 대한 기준점을 만들려면 동적 링크 라이브러리, 모듈 그리고 드라이버에 대해 생각해봐야 한다. 동적 링크 라이브러리(DLLs)가 가지는 코드와 자원은 여러 프로세스 사이에 공유된다. 모듈은 운영체제 커널에서 로드되는 코드다. 마지막으로 드라이버는 하드웨어 장치와 통신할 수 있게 컴퓨터에서 허용하는 코드다. (Ligh, Case, Levy, 그리고 Walters, 2014). 이러한 각각의 아티팩트는 많은 수의 객체로 구성되기에, 검색보다는 실제 시스템을 분석하여 기준점을 만드는 것을 추천한다.
포렌식 분석가가 관심을 갖는 또 다른 속성은 프로세스에 의해 개방되어 연결되는 네트워크다. 이들은 netscan 플러그인을 사용하여 볼 수 있다. 기준점의 네트워크 연결 부분은 실제 시스템에서 데이터를 수집한 다음 분석하여 구성한다.
3.3. 일반적인 윈도우 서버 2008 R2에 대한 기본점 테스트
초기 메모리 기준점을 만들었으므로, 실제 시스템에서 수집한 메모리 이미지와 비교하여 유효성을 검사하고 개선할 수 있다. 첫 번째 Windows 2008 R2 서버는 작업 그룹의 일부인 일반 표준 설치를 사용하여 구축했다. Windows 미디어를 이용한 새로운 설치이기에 "깨끗"한 것으로 간주한다.
3.3.1. 불량 프로세스 식별
메모리 분석 방법론의 1 단계는 불량 프로세스 찾는 것으로 시작한다. 깨끗한 서버이기에 불량 프로세스가 없어야 하므로 초기 기준점에 포함되지 않은 프로세스를 찾는다.
아래 출력은 볼라티리티의 pslist 플러그인을 사용하여 출력한 프로세스 목록이다. 페이지에 맞추기 위해 cut 명령을 사용하여 관련이 없는 출력은 제거했다. 부팅 프로세스를 로그온 프로세스와 분리하기 위해 이들 사이에 시간차를 두었다. 이는 아래에 표시된 시작 시간 열에서 볼 수 있다.
$ vol.py -f win2008r2-01-a.img pslist | cut -c 20-76,84-104
Volatility Foundation Volatility Framework 2.3.1
Name PID PPID Thds Hnds Sess Start
-------------------- ------ ------ ------ -------- ------ --------------------
System 4 0 76 460 ------ 2014-06-22 13:26:36
smss.exe 232 4 2 29 ------ 2014-06-22 13:26:36
csrss.exe 324 316 9 335 0 2014-06-22 13:26:42
csrss.exe 376 368 10 189 1 2014-06-22 13:26:43
wininit.exe 384 316 3 79 0 2014-06-22 13:26:43
winlogon.exe 420 368 3 96 1 2014-06-22 13:26:43
services.exe 480 384 8 189 0 2014-06-22 13:26:44
lsass.exe 488 384 6 530 0 2014-06-22 13:26:45
lsm.exe 496 384 10 145 0 2014-06-22 13:26:45
svchost.exe 588 480 11 345 0 2014-06-22 13:26:48
svchost.exe 656 480 6 233 0 2014-06-22 13:26:49
svchost.exe 744 480 13 288 0 2014-06-22 13:26:49
svchost.exe 788 480 26 824 0 2014-06-22 13:26:49
svchost.exe 836 480 10 508 0 2014-06-22 13:26:50
svchost.exe 884 480 7 198 0 2014-06-22 13:26:51
svchost.exe 928 480 16 429 0 2014-06-22 13:26:51
svchost.exe 216 480 17 289 0 2014-06-22 13:26:53
spoolsv.exe 904 480 13 313 0 2014-06-22 13:26:54
svchost.exe 1040 480 3 46 0 2014-06-22 13:26:56
vmtoolsd.exe 1096 480 9 253 0 2014-06-22 13:26:56
TPAutoConnSvc. 1292 480 10 140 0 2014-06-22 13:26:59
dllhost.exe 1456 480 13 194 0 2014-06-22 13:27:01
msdtc.exe 1612 480 12 147 0 2014-06-22 13:27:03
svchost.exe 1752 480 5 67 0 2014-06-22 13:29:01
taskhost.exe 1276 480 5 118 1 2014-06-22 13:34:03
TPAutoConnect. 1328 1292 5 126 1 2014-06-22 13:34:03
conhost.exe 1556 376 1 30 1 2014-06-22 13:34:03
dwm.exe 1116 884 3 65 1 2014-06-22 13:34:03
explorer.exe 848 968 15 478 1 2014-06-22 13:34:03
vmtoolsd.exe 2012 848 7 184 1 2014-06-22 13:34:06
cmd.exe 332 848 1 20 1 2014-06-22 13:39:31
conhost.exe 1228 376 2 36 1 2014-06-22 13:39:31
win64dd.exe 868 332 2 49 1 2014-06-22 13:52:33
위에 굵게 표시된 줄은 기준점에 존재하지 않은 프로세스를 의미한한다. 이들은 더욱 면밀히 조사해야할 대상이다.
서버는 Vmware Workstation에서 실행되므로, 일반적인 윈도우 설치의 일부가 아닌 VMware와 관련된 프로세스가 존재할 수 있다. 이와 관련해서 실제로 TPAutoConnSvc.exe, TPAutoConnect.exe 그리고 vmtoolsd.exe 세 프로세스를 볼 수 있다. VMware와의 관계에 관한 단서는 프로세스 정보를 자세히 검토할 때 제공받는다. 이 프로세스들은 각각 dlllist 플러그인을 통해 출려된 것 처럼 C:\Program Files\VMware\VMware Tools\ 디렉터리에서 실행된다.
$ vol.py -f win2008r2-01-a.img dlllist -p 1096 | grep -B 1 -i "command line"
Volatility Foundation Volatility Framework 2.3.1
vmtoolsd.exe pid: 1096
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe"
$ vol.py -f win2008r2-01-a.img dlllist -p 1292 | grep -B 1 -i "command line"
Volatility Foundation Volatility Framework 2.3.1
TPAutoConnSvc. pid: 1292
Command line : "C:\Program Files\VMware\VMware Tools\TPAutoConnSvc.exe"
$ vol.py -f win2008r2-01-a.img dlllist -p 1328 | grep -B 1 -i "command line"
Volatility Foundation Volatility Framework 2.3.1
TPAutoConnect. pid: 1328
Command line : TPAutoConnect.exe -q -i vmware -a COM1 -F 30
VMware Knowledge base (2014)는 가상 인쇄 모듈이 설치될 때 TPAutoConnect.exe와 TPautoConnSvc.exe가 시작되는 것으로 설명한다. 세션 0의 서비스 제어 관리자(SCM)가 TPAutoConnSvc.exe를 시작하는 것을 pslist 출력에서 확인할 수 있다. TPAutoConnect.exe는 세션 1을 초기화 할 때 TPAutoConnSvc.exe에 의해 시작된다. VMware 도구 서비스 (vmtoolsd.exe)는 게스트 윈도우 운영 체제 (VMware, 2011)에 설치된다. pslist 결과에서 세션 0과 세션 1 모두에서 실행중인 vmtoolsd.exe의 인스턴스가 있음을 알 수 있다. 따라서 이러한 프로세스는 기준점에 추가된다.
일부 메모리 아티팩트는 사용자 로그온에 의해 도입된다. LogonUI.exe는 사용자가 로그인했기에 존재하지 않는다. 대신 taskhost.exe, conhost.exe 그리고 dwm.exe를 포함하여 로그인 성공과 관련된 여러 프로세스를 볼 수 있다. 이러한 프로세스는 초기 기준점의 일부가 되지 않는다. 표 4는 사용자가 로그온 할 때 시작되는 프로세스의 수정된 목록을 제공한다.
또 다른 그룹의 아티팩트는 실제 메모리 획득과 관련있다. cmd.exe는 win64dd.exe (PID 868)가 메모리 이미지 수집을 위해 시작하기 위해 관리 모드(PID - 332)로 실행 되었다. cmd.exe가 실행되면 윈도우는 지원 프로세스인 콘솔 호스트(conhost.exe - PID 1228)도 실행된다. 이러한 마지막 그룹은 프로세스 기준점의 일부는 아니지만 메모리 이미지를 분석 할 때 고려해야할 사항이다.
spoollvc.exe, dllhost.exe 그리고 msdtc.exe 프로세스가 초기 기준점의 일부가 아닌 services.exe에 의해 시작되었다. dllhost.exe는 COM(Component Object Model) 개체 (Startup Programs Database, 2014c) 관리와 연결된다. msdtc.exe는 분산 트랙잭션 코디네이터 (Startup Programs Database, 2014d)다. spoolsvc.exe는 스풀러 서비스이며 인쇄와 관련있다. (Startup Programs Database, 2014e)
3.3.2. 프로세스 개체 분석
메모리 분석 방법론의 2 단계는 프로세스 개체를 검사하는 것이다. 볼라티리티 플러그인으로 dlllist을 사용할 것이다. 매우 장황하기 때문에 명령을 통해 smss.exe라는 하나의 프로세스 (PID는 232)로 제한했다. 이 명령의 출력은 아래에서 볼 수 있듯이 프로세스를 시작하는데 사용된 명령과 프로세스와 관련된 DLL에 대한 정보를 제공한다.
$ vol.py -f win2008r2-01-a.img -p 232 dlllist
Volatility Foundation Volatility Framework 2.3.1
************************************************************************
smss.exe pid: 232
Command line : \SystemRoot\System32\smss.exe
Base Size LoadCount Path
------------------ -------------- -------------- ----
0x0000000047a50000 0x20000 0xffff \SystemRoot\System32\smss.exe
0x0000000077120000 0x1a9000 0xffff C:\Windows\SYSTEM32\ntdll.dll
관심 가져야할 부분은 프로세스 이름, 프로세스 ID 그리고 프로세스를 시작하는데 사용된 커맨드라인이므로 dlllist 플러그인에서 grep을 사용하여 커맨드라인을 출력하여 축약된 결과물을 생성할 수 있다.
$ vol.py -f win2008r2-01-a.img dlllist | grep -B 1 -i "command line"
Volatility Foundation Volatility Framework 2.3.1
smss.exe pid: 232
Command line : \SystemRoot\System32\smss.exe
--
csrss.exe pid: 324
Command line : %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,20480,768 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4
ProfileControl=Off MaxRequestThreads=16
--
csrss.exe pid: 376
Command line : %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,20480,768 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4
ProfileControl=Off MaxRequestThreads=16
--
wininit.exe pid: 384
Command line : wininit.exe
--
winlogon.exe pid: 420
Command line : winlogon.exe
--
services.exe pid: 480
Command line : C:\Windows\system32\services.exe
--
lsass.exe pid: 488
Command line : C:\Windows\system32\lsass.exe
--
lsm.exe pid: 496
Command line : C:\Windows\system32\lsm.exe
--
svchost.exe pid: 588
Command line : C:\Windows\system32\svchost.exe -k DcomLaunch
--
svchost.exe pid: 656
Command line : C:\Windows\system32\svchost.exe -k RPCSS
--
svchost.exe pid: 744
Command line : C:\Windows\System32\svchost.exe -k LocalServiceNetworkRestricted
--
svchost.exe pid: 788
Command line : C:\Windows\system32\svchost.exe -k netsvcs
--
svchost.exe pid: 836
Command line : C:\Windows\system32\svchost.exe -k LocalService
--
svchost.exe pid: 884
Command line : C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted
--
svchost.exe pid: 928
Command line : C:\Windows\system32\svchost.exe -k NetworkService
--
svchost.exe pid: 216
Command line : C:\Windows\system32\svchost.exe -k LocalServiceNoNetwork
--
spoolsv.exe pid: 904
Command line : C:\Windows\System32\spoolsv.exe
--
svchost.exe pid: 1040
Command line : C:\Windows\system32\svchost.exe -k regsvc
--
vmtoolsd.exe pid: 1096
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe"
--
TPAutoConnSvc. pid: 1292
Command line : "C:\Program Files\VMware\VMware Tools\TPAutoConnSvc.exe"
--
dllhost.exe pid: 1456
Command line : C:\Windows\system32\dllhost.exe /Processid:{02D4B3F1-FD88-11D1-
960D-00805FC79235}
--
msdtc.exe pid: 1612
Command line : C:\Windows\System32\msdtc.exe
--
svchost.exe pid: 1752
Command line : C:\Windows\system32\svchost.exe -k
LocalServiceAndNoImpersonation
--
taskhost.exe pid: 1276
Command line : "taskhost.exe"
--
TPAutoConnect. pid: 1328
Command line : TPAutoConnect.exe -q -i vmware -a COM1 -F 30
--
conhost.exe pid: 1556
Command line : \??\C:\Windows\system32\conhost.exe
--
dwm.exe pid: 1116
Command line : "C:\Windows\system32\Dwm.exe"
--
explorer.exe pid: 848
Command line : C:\Windows\Explorer.EXE
--
vmtoolsd.exe pid: 2012
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr
--
cmd.exe pid: 332
Command line : "C:\Windows\system32\cmd.exe"
--
conhost.exe pid: 1228
Command line : \??\C:\Windows\system32\conhost.exe
--
win64dd.exe pid: 868
Command line : win64dd /f win2008r2-01-a.img
프로세스를 시작하고 services.exe에서 시작한 서비스 그룹을 식별하는데 사용되는 명령의 유효성을 검사하기 위해 dlllist 플러그인의 출력을 기준점과 비교한다. 이를 통해 DcomLaunch, PRCSS 그리고 regsvc의 세 가지 서비스 그룹을 신속하게 파악할 수 있다. 이들 모드 기준점에 존재하지 않아 추가될 필요가 있다.
프로세스 분석 단계에는 프로세스가 예외 계정으로 실행중인지 확인하는 작업을 포함한다. 이 정보는 볼라이티리 플러그인 getsid를 통해 작업할 수 있다. 아래의 예는 PID가 488인 하나의 프로세스에 대한 출력을 보여준다.
$ vol.py -f win2008r2-01-a.img -p 488 getsids
Volatility Foundation Volatility Framework 2.3.1
lsass.exe (488): S-1-5-18 (Local System)
lsass.exe (488): S-1-5-32-544 (Administrators)
lsass.exe (488): S-1-1-0 (Everyone)
lsass.exe (488): S-1-5-11 (Authenticated Users)
lsass.exe (488): S-1-16-16384 (System Mandatory Level)
볼라티리티 출력은 아래와 같이 uniq 명령을 사용하여 축약할 수 있다. 다음은 각 프로세스와 그 프로세스를 실행시킨 계정의 목록이다. uniq 명령은 완벽하지 않다. 시스템에 몇 줄의 중복 선이 표시되지만 분석 프로세스는 여전히 단순하다.
$ vol.py -f win2008r2-01-a.img getsids | uniq -w 18
Volatility Foundation Volatility Framework 2.3.1
System (4): S-1-5-18 (Local System)
System (4): S-1-1-0 (Everyone)
System (4): S-1-5-11 (Authenticated Users)
System (4): S-1-16-16384 (System Mandatory Level)
smss.exe (232): S-1-5-18 (Local System)
csrss.exe (324): S-1-5-18 (Local System)
csrss.exe (376): S-1-5-18 (Local System)
wininit.exe (384): S-1-5-18 (Local System)
winlogon.exe (420): S-1-5-18 (Local System)
services.exe (480): S-1-5-18 (Local System)
lsass.exe (488): S-1-5-18 (Local System)
lsm.exe (496): S-1-5-18 (Local System)
svchost.exe (588): S-1-5-18 (Local System)
svchost.exe (656): S-1-5-20 (NT Authority)
svchost.exe (744): S-1-5-19 (NT Authority)
svchost.exe (788): S-1-5-18 (Local System)
svchost.exe (836): S-1-5-19 (NT Authority)
svchost.exe (884): S-1-5-18 (Local System)
svchost.exe (928): S-1-5-20 (NT Authority)
svchost.exe (216): S-1-5-19 (NT Authority)
spoolsv.exe (904): S-1-5-18 (Local System)
svchost.exe (1040): S-1-5-19 (NT Authority)
vmtoolsd.exe (1096): S-1-5-18 (Local System)
TPAutoConnSvc. (1292): S-1-5-18 (Local System)
dllhost.exe (1456): S-1-5-18 (Local System)
msdtc.exe (1612): S-1-5-20 (NT Authority)
svchost.exe (1752): S-1-5-19 (NT Authority)
taskhost.exe (1276): S-1-5-21-2236604341-3981238657-2714753860-1000
TPAutoConnect. (1328): S-1-5-21-2236604341-3981238657-2714753860-1000
conhost.exe (1556): S-1-5-21-2236604341-3981238657-2714753860-1000
dwm.exe (1116): S-1-5-21-2236604341-3981238657-2714753860-1000
explorer.exe (848): S-1-5-21-2236604341-3981238657-2714753860-1000
vmtoolsd.exe (2012): S-1-5-21-2236604341-3981238657-2714753860-1000
cmd.exe (332): S-1-5-21-2236604341-3981238657-2714753860-1000
conhost.exe (1228): S-1-5-21-2236604341-3981238657-2714753860-1000
win64dd.exe (868): S-1-5-21-2236604341-3981238657-2714753860-1000
위 출력에서 한 가지 주의 사항은 두 개의 SID가 볼라티리티에 의해 NT Authority로 나열된다는 것이다. S-1-5-19는 로컬 서비스로 변환되고 S-1-5-20은 네트워크 서비스(Microsoft Knowledge Base, 2013a)로 변환된다. "-1000"으로 끝나는 긴 번호를 가진 SID는 사용자와 연결된다. 따라서 taskhost.exe, cmd.exe 그리고 win64dd.exe와 같은 프로세스는 사용자 컨텍스트에서 실행 중이다.
예상대로 svchost를 사용하여 시작된 여러 서비스에는 서비스 그룹의 요구사항에 따라 다른 SID가 존재한다. 또한 로그온 한 사용자와 관련된 프로세는 사용자 SID와 연결된다.
분석할 또 다른 메모리 아티팩트는 DLL이다. dlllist 플러그인으로 생성된 DLL의 전체 목록은 다소 길다. 앞에서 설명한 것 처럼 DLL 외에 다른 정보를 포함한다. DLL을 나열하는 각 행은 "0x"로 시작하고 dlllist 플러그인의 출력은 DLL만 나열하도록 생성하는 장점을 이용할 수 있다. 다음 명령은 DLL이 들어있는 행을 나열한 다음 계산한다. 전체적으로 1,411개의 DLL이 확인되었다.
$ vol.py -f win2008r2-01-a.img dlllist | grep "^0x" | cut -c 20-37,57- | wc -l
Volatility Foundation Volatility Framework 2.3.1
1411
DLL 목록을 검사하면, 여러 프로세스가 동일한 DLL을 사용하기에 중복되어 있다는 사실이 명확해진다. 목록을 정렬한 다음 고유한 행만 표시하고 대소문자를 무시함으로써 목록을 상당히 줄일 수 있다. 아래의 명령은 메모리 이미지에서 370개로 축소한 것을 보여준다.
$ vol.py -f win2008r2-01-a.img dlllist | grep "^0x" | cut -c 20-37,57- | sort | uniq -i | wc -l
Volatility Foundation Volatility Framework 2.3.1
370
기준점에서 370개 항목을 나열하는 표를 작성하는 대신 다른 메모리 이미지에서 실행된 동일한 명령의 출력과 비교할 수 있는 파일을 작성하여 기준점에 나열되지 않은 DLL을 찾는다. 파일은 속하지 않은 항목이 없는지 확인하기 위해 검토되어야 한다. 하나의 항목인 win64dd.exe는 메모리 수집 프로세스의 일부로 도입되었기에 제거해야 한다. DLL 기준점을 만드는데 사용되는 명령은 다음과 같다.
$ vol.py -f win2008r2-01-a.img dlllist | grep "^0x" | cut -c 20-37,57- | sort | uniq -i > dll-baseline-01.lst
Volatility Foundation Volatility Framework 2.3.
유사하게, 볼라티리티는 모듈이라고 불리는 커널 모듈을 메모리에 나열할 수 있게 플러그인을 제공한다. 출력된 결과를 검토하면 메모리에 147개의 모듈이 있다. 비슷한 접근 방식을 사용하여 아래와 같이 모듈의 기준점을 작성한다.
$ vol.py -f win2008r2-01-a.img modules | cut -c 20-40,60- | grep "0x" | sort | uniq -i | wc -l
Volatility Foundation Volatility Framework 2.3.1
147
$ vol.py -f win2008r2-01-a.img modules | cut -c 20-40,60- | grep "0x" | sort | uniq -i > module-base-01.lst
Volatility Foundation Volatility Framework 2.3.1
$ cat module-base-01.lst | wc -l
147
파일은 속하지 않은 항목이 없는지 확인하기 위해 검토헤애 한다. Win64dd.sys는 메모리 수집 프로세스의 아티팩트이기에 제거되었다.
3.3.3. 네트워크 아티팩트 검토
Windows Vista와 Windows Server 2008부터 마이크로소프트는 IANA 권장 사항(Microsoft Knowledge Base, 2013c)에 따라 동적 포트 범위 할당을 1025부터 5000을 49152에서 65535로 변경했다. 볼라티리티의 netscan 플러그인은 열린 포트 목록과 해당 포트를 소유한 프로세스 목록을 제공한다. 각 svchost.exe 인스턴스를 소유하고 있는지 확인하기 위해 추가 분석을 수행한다. 예를 들어 다음을 고려한다.
$ vol.py -f win2008r2-01-a.img netscan | cut -c 12-18,21-40,51-63,88-92,94-112 | uniq -w 20
Volatility Foundation Volatility Framework 2.3.1
Proto Local Address Foreign Addr Pid Owner
TCPv4 0.0.0.0:49156 0.0.0.0:0 480 services.exe
TCPv6 :::49156 :::0 480 services.exe
TCPv4 0.0.0.0:445 0.0.0.0:0 4 System
TCPv6 :::445 :::0 4 System
TCPv4 0.0.0.0:47001 0.0.0.0:0 4 System
TCPv6 :::47001 :::0 4 System
TCPv4 0.0.0.0:49153 0.0.0.0:0 744 svchost.exe
TCPv6 :::49153 :::0 744 svchost.exe
TCPv4 0.0.0.0:49154 0.0.0.0:0 788 svchost.exe
TCPv4 192.168.139.129:139 0.0.0.0:0 4 System
TCPv4 0.0.0.0:135 0.0.0.0:0 656 svchost.exe
TCPv6 :::135 :::0 656 svchost.exe
TCPv4 0.0.0.0:49152 0.0.0.0:0 384 wininit.exe
TCPv6 :::49152 :::0 384 wininit.exe
TCPv4 0.0.0.0:49155 0.0.0.0:0 488 lsass.exe
TCPv6 :::49155 :::0 488 lsass.exe
TCPv4 0.0.0.0:49154 0.0.0.0:0 788 svchost.exe
TCPv6 :::49154 :::0 788 svchost.exe
UDPv4 0.0.0.0:5355 *:* 928 svchost.exe
UDPv4 0.0.0.0:0 *:* 928 svchost.exe
UDPv6 :::0 *:* 928 svchost.exe
UDPv4 0.0.0.0:123 *:* 836 svchost.exe
UDPv6 :::123 *:* 836 svchost.exe
UDPv4 0.0.0.0:123 *:* 836 svchost.exe
UDPv4 0.0.0.0:0 *:* 836 svchost.exe
UDPv6 :::0 *:* 836 svchost.exe
UDPv4 0.0.0.0:0 *:* 836 svchost.exe
UDPv4 192.168.139.129:137 *:* 4 System
UDPv4 0.0.0.0:5355 *:* 928 svchost.exe
UDPv6 :::5355 *:* 928 svchost.exe
표 5는 netscan 플러그인으로 식별되는 Windows Server 2008 R2가 여는 포트 목록이다. 이 목록은 초기 기준점을 설정하며 SMB(Server Message Block)와 NETBIOS를 비롯하여 보안상의 이유로 조직에서 사용하지 않도록 설정할 수 있는 일부 서비스를 포함한다.
3.4. 연결된 윈도우 서버 2008 R2 부속 도메인에 대한 기준점 테스트
다른 시스템에 대해 새롭게 수정한 기준점을 사용하여 프로세스를 반복적으로 검증하여 세부 사항을 조정한다. 기준점을 테스트하기 위해 두 번재 Windows Server 2008 R2는 도메인에 연결되어 있고 원격 로그온 사용을 통해 어떤 차이가 있는지 알 수 있는 예외와 함께 첫 번째 구성과 동일한 구성을 사용하여 만들었다. 이 이미지에서 두 명의 사용자는 원격으로 서버에 로그인하고 마이크로소프트 터미널 서버 연결(mstsc)을 사용하며 콘솔을 통해 하나를 사용한다. 메모리 이미지는 원격 사용자에 의해 생성했다.
3.4.1. 불량 프로세스 식별
우리의 분석은 불량 프로세스를 식별할 수 있도록 pslist 플러그인을 실행하여 프로세스 목록을 얻는 것에서 시작한다. 다음 사항을 고려한다.
$ vol.py -f win2008r2-03-s1.img pslist | cut -c 20-53,70-76,84-114
Volatility Foundation Volatility Framework 2.3.1
Name PID PPID Sess Start
-------------------- ------ ------ ------ ------------------------------
System 4 0 ------ 2014-07-28 01:26:59 UTC+0000
smss.exe 224 4 ------ 2014-07-28 01:26:59 UTC+0000
csrss.exe 316 308 0 2014-07-28 01:27:04 UTC+0000
wininit.exe 368 308 0 2014-07-28 01:27:04 UTC+0000
services.exe 472 368 0 2014-07-28 01:27:05 UTC+0000
lsass.exe 480 368 0 2014-07-28 01:27:05 UTC+0000
lsm.exe 488 368 0 2014-07-28 01:27:05 UTC+0000
svchost.exe 584 472 0 2014-07-28 01:27:10 UTC+0000
svchost.exe 660 472 0 2014-07-28 01:27:11 UTC+0000
svchost.exe 740 472 0 2014-07-28 01:27:11 UTC+0000
svchost.exe 796 472 0 2014-07-28 01:27:11 UTC+0000
svchost.exe 848 472 0 2014-07-28 01:27:12 UTC+0000
svchost.exe 888 472 0 2014-07-28 01:27:12 UTC+0000
svchost.exe 932 472 0 2014-07-28 01:27:13 UTC+0000
svchost.exe 236 472 0 2014-07-28 01:27:14 UTC+0000
spoolsv.exe 324 472 0 2014-07-28 01:27:15 UTC+0000
svchost.exe 1092 472 0 2014-07-28 01:27:16 UTC+0000
vmtoolsd.exe 1148 472 0 2014-07-28 01:27:16 UTC+0000
svchost.exe 1412 472 0 2014-07-28 01:27:18 UTC+0000
svchost.exe 1472 472 0 2014-07-28 01:27:18 UTC+0000
TPAutoConnSvc. 1508 472 0 2014-07-28 01:27:19 UTC+0000
dllhost.exe 1776 472 0 2014-07-28 01:27:22 UTC+0000
msdtc.exe 1896 472 0 2014-07-28 01:27:23 UTC+0000
svchost.exe 1204 472 0 2014-07-28 01:29:19 UTC+0000
sppsvc.exe 1068 472 0 2014-08-02 20:10:58 UTC+0000
TrustedInstall 252 472 0 2014-08-02 20:11:00 UTC+0000
csrss.exe 3020 2956 1 2014-08-02 20:16:53 UTC+0000
winlogon.exe 2896 2956 1 2014-08-02 20:16:53 UTC+0000
taskhost.exe 1264 472 1 2014-08-02 20:17:25 UTC+0000
dwm.exe 2328 888 1 2014-08-02 20:17:25 UTC+0000
explorer.exe 1284 3068 1 2014-08-02 20:17:25 UTC+0000
vmtoolsd.exe 1556 1284 1 2014-08-02 20:17:25 UTC+0000
TPAutoConnect. 2712 1508 1 2014-08-02 20:17:25 UTC+0000
conhost.exe 2856 3020 1 2014-08-02 20:17:25 UTC+0000
csrss.exe 2232 376 2 2014-08-02 20:18:27 UTC+0000
winlogon.exe 2124 376 2 2014-08-02 20:18:27 UTC+0000
taskhost.exe 2116 472 2 2014-08-02 20:18:29 UTC+0000
rdpclip.exe 2108 1412 2 2014-08-02 20:18:29 UTC+0000
dwm.exe 2088 888 2 2014-08-02 20:18:29 UTC+0000
explorer.exe 2708 1388 2 2014-08-02 20:18:29 UTC+0000
vmtoolsd.exe 1124 2708 2 2014-08-02 20:18:29 UTC+0000
TPAutoConnect. 2012 1508 2 2014-08-02 20:18:30 UTC+0000
conhost.exe 672 2232 2 2014-08-02 20:18:30 UTC+0000
cmd.exe 1268 2708 2 2014-08-02 20:18:40 UTC+0000
conhost.exe 2904 2232 2 2014-08-02 20:18:40 UTC+0000
win64dd.exe 2836 1268 2 2014-08-02 20:19:53 UTC+0000
services.exe에 의해 시작된 두 개의 새 프로세스 sppsvc.exe와 TrustedInstall이 세션 0에 나타난다. sppsvc.exe는 마이크로소프트의 소프트웨어 보호 서비스며 윈도우와 마이크로소프트 응용 프로그램(Startup Programs Database, 2014a)을 위한 디지털 라이선스를 관리하는 것과 관련있다. TrustedInstaller.exe는 윈도우 모듈 설치 프로그램이며 윈도우 업데이트(Startup Programs Database, 2014b)와 관련있다. 이 프로세스는 시스템 부팅 직후에 만들어 졌으므로 추가 기준점에 표시되지 않았을 수 있다.
두 개의 사용자 세션 1과 2를 검사할 때 기본 세션과 일관성 있음을 알 수 있다.
3.4.2. 프로세스 개체 분석(Analyze Process Objects)
다시 한번 dlllist 플러그인을 실행하여 프로세스 오브젝트 분석을 시작한다.
$ vol.py -f win2008r2-03-s1.img dlllist | grep -B 1 -i "command line"
Volatility Foundation Volatility Framework 2.3.1
smss.exe pid: 224
Command line : \SystemRoot\System32\smss.exe
--
csrss.exe pid: 316
Command line : %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,20480,768 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4
ProfileControl=Off MaxRequestThreads=16
--
wininit.exe pid: 368
Command line : wininit.exe
--
services.exe pid: 472
Command line : C:\Windows\system32\services.exe
--
lsass.exe pid: 480
Command line : C:\Windows\system32\lsass.exe
--
lsm.exe pid: 488
Command line : C:\Windows\system32\lsm.exe
--
svchost.exe pid: 584
Command line : C:\Windows\system32\svchost.exe -k DcomLaunch
--
svchost.exe pid: 660
Command line : C:\Windows\system32\svchost.exe -k RPCSS
--
svchost.exe pid: 740
Command line : C:\Windows\System32\svchost.exe -k LocalServiceNetworkRestricted
--
svchost.exe pid: 796
Command line : C:\Windows\system32\svchost.exe -k netsvcs
--
svchost.exe pid: 848
Command line : C:\Windows\system32\svchost.exe -k LocalService
--
svchost.exe pid: 888
Command line : C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted
--
svchost.exe pid: 932
Command line : C:\Windows\system32\svchost.exe -k NetworkService
--
svchost.exe pid: 236
Command line : C:\Windows\system32\svchost.exe -k LocalServiceNoNetwork
--
spoolsv.exe pid: 324
Command line : C:\Windows\System32\spoolsv.exe
--
svchost.exe pid: 1092
Command line : C:\Windows\system32\svchost.exe -k regsvc
--
vmtoolsd.exe pid: 1148
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe"
--
svchost.exe pid: 1412
Command line : C:\Windows\System32\svchost.exe -k termsvcs
--
svchost.exe pid: 1472
Command line : C:\Windows\system32\svchost.exe -k
NetworkServiceNetworkRestricted
--
TPAutoConnSvc. pid: 1508
Command line : "C:\Program Files\VMware\VMware Tools\TPAutoConnSvc.exe"
--
dllhost.exe pid: 1776
Command line : C:\Windows\system32\dllhost.exe /Processid:{02D4B3F1-FD88-11D1-
960D-00805FC79235}
--
msdtc.exe pid: 1896
Command line : C:\Windows\System32\msdtc.exe
--
svchost.exe pid: 1204
Command line : C:\Windows\system32\svchost.exe -k
LocalServiceAndNoImpersonation
--
sppsvc.exe pid: 1068
Command line : C:\Windows\system32\sppsvc.exe
--
TrustedInstall pid: 252
Command line : C:\Windows\servicing\TrustedInstaller.exe
--
csrss.exe pid: 3020
Command line : %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,20480,768 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4
ProfileControl=Off MaxRequestThreads=16
--
winlogon.exe pid: 2896
Command line : winlogon.exe
--
taskhost.exe pid: 1264
Command line : "taskhost.exe"
--
dwm.exe pid: 2328
Command line : "C:\Windows\system32\Dwm.exe"
--
explorer.exe pid: 1284
Command line : C:\Windows\Explorer.EXE
--
vmtoolsd.exe pid: 1556
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr
--
TPAutoConnect. pid: 2712
Command line : TPAutoConnect.exe -q -i vmware -a COM1 -F 30
--
conhost.exe pid: 2856
Command line : \??\C:\Windows\system32\conhost.exe
--
csrss.exe pid: 2232
Command line : %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,20480,768 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4
ProfileControl=Off MaxRequestThreads=16
--
winlogon.exe pid: 2124
Command line : winlogon.exe
--
taskhost.exe pid: 2116
Command line : "taskhost.exe"
--
rdpclip.exe pid: 2108
Command line : rdpclip
--
dwm.exe pid: 2088
Command line : "C:\Windows\system32\Dwm.exe"
--
explorer.exe pid: 2708
Command line : C:\Windows\Explorer.EXE
--
vmtoolsd.exe pid: 1124
Command line : "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr
--
TPAutoConnect. pid: 2012
Command line : TPAutoConnect.exe -q -i vmware -a COM1 -F 30
--
conhost.exe pid: 672
Command line : \??\C:\Windows\system32\conhost.exe
--
cmd.exe pid: 1268
Command line : "C:\Windows\system32\cmd.exe"
--
conhost.exe pid: 2904
Command line : \??\C:\Windows\system32\conhost.exe
--
win64dd.exe pid: 2836
Command line : win64dd /f win2008r2-03-s1.img
메모리 이미지에 두 개의 새로운 서비스, termsbcs와 서비스 그룹 NetworkServiceNetworkRestricted이 나타난다. 원격 데스크톱을 사용하도록 설정하면 이러한 문제가 발생할 수 있다. 다른 프로세스는 모두 기준점에 있고 실행 파일 경로는 정확하다.
getsids 플러그인을 실행하면 프로세스가 실행중인 계정을 제공한다. termsvcs와 서비스 그룹 NetworkServiceNetworkRestricted은 네트워크 서비스에서 실행 중이다. 다른 모든 프로세스는 예상되는 계정에서 실행된다.
$ vol.py -f win2008r2-03-s1.img getsids | uniq -w 18
Volatility Foundation Volatility Framework 2.3.1
System (4): S-1-5-18 (Local System)
System (4): S-1-1-0 (Everyone)
System (4): S-1-5-11 (Authenticated Users)
System (4): S-1-16-16384 (System Mandatory Level)
smss.exe (224): S-1-5-18 (Local System)
csrss.exe (316): S-1-5-18 (Local System)
wininit.exe (368): S-1-5-18 (Local System)
services.exe (472): S-1-5-18 (Local System)
lsass.exe (480): S-1-5-18 (Local System)
lsm.exe (488): S-1-5-18 (Local System)
svchost.exe (584): S-1-5-18 (Local System)
svchost.exe (660): S-1-5-20 (NT Authority)
svchost.exe (740): S-1-5-19 (NT Authority)
svchost.exe (796): S-1-5-18 (Local System)
svchost.exe (848): S-1-5-19 (NT Authority)
svchost.exe (888): S-1-5-18 (Local System)
svchost.exe (932): S-1-5-20 (NT Authority)
svchost.exe (236): S-1-5-19 (NT Authority)
spoolsv.exe (324): S-1-5-18 (Local System)
svchost.exe (1092): S-1-5-19 (NT Authority)
vmtoolsd.exe (1148): S-1-5-18 (Local System)
svchost.exe (1412): S-1-5-20 (NT Authority)
svchost.exe (1472): S-1-5-20 (NT Authority)
TPAutoConnSvc. (1508): S-1-5-18 (Local System)
dllhost.exe (1776): S-1-5-18 (Local System)
msdtc.exe (1896): S-1-5-20 (NT Authority)
svchost.exe (1204): S-1-5-19 (NT Authority)
sppsvc.exe (1068): S-1-5-20 (NT Authority)
TrustedInstall (252): S-1-5-18 (Local System)
csrss.exe (3020): S-1-5-18 (Local System)
winlogon.exe (2896): S-1-5-18 (Local System)
taskhost.exe (1264): S-1-5-21-4249217695-1663262354-3778214704-1110
dwm.exe (2328): S-1-5-21-4249217695-1663262354-3778214704-1110
explorer.exe (1284): S-1-5-21-4249217695-1663262354-3778214704-1110
vmtoolsd.exe (1556): S-1-5-21-4249217695-1663262354-3778214704-1110
TPAutoConnect. (2712): S-1-5-21-4249217695-1663262354-3778214704-1110
conhost.exe (2856): S-1-5-21-4249217695-1663262354-3778214704-1110
csrss.exe (2232): S-1-5-18 (Local System)
winlogon.exe (2124): S-1-5-18 (Local System)
taskhost.exe (2116): S-1-5-21-4249217695-1663262354-3778214704-1109
rdpclip.exe (2108): S-1-5-21-4249217695-1663262354-3778214704-1109
dwm.exe (2088): S-1-5-21-4249217695-1663262354-3778214704-1109
explorer.exe (2708): S-1-5-21-4249217695-1663262354-3778214704-1109
vmtoolsd.exe (1124): S-1-5-21-4249217695-1663262354-3778214704-1109
TPAutoConnect. (2012): S-1-5-21-4249217695-1663262354-3778214704-1109
conhost.exe (672): S-1-5-21-4249217695-1663262354-3778214704-1109
cmd.exe (1268): S-1-5-21-4249217695-1663262354-3778214704-1109
conhost.exe (2904): S-1-5-21-4249217695-1663262354-3778214704-1109
win64dd.exe (2836): S-1-5-21-4249217695-1663262354-3778214704-1109
두 번째 이미지에서 DLL을 분석하기 위해 위에서 사용한 동일한 방법으로 1,990개의 인스턴스를 식별한다. 다시 말하자면, 이 숫자는 중복을 분류하고 제거하여 신경써야할 부분을 크게 줄일 수 있다.
$ vol.py -f win2008r2-03-s1.img dlllist | grep "^0x" | cut -c 20-37,57- | wc -l
Volatility Foundation Volatility Framework 2.3.1
1990
$ vol.py -f win2008r2-03-s1.img dlllist | grep "^0x" | cut -c 20-37,57- | sort | uniq -i | wc -l
Volatility Foundation Volatility Framework 2.3.1
397
다음으로 DLL 기본 파일과 동일한 형식으로 397개의 DLL을 포함하는 파일을 생성한다. 다시 검사할 때 wc를 사용하여 라인 수를 계산했다.
$ vol.py -f win2008r2-03-s1.img dlllist | grep "^0x" | cut -c 20-37,57- | sort | uniq -i > dll-03.lst
Volatility Foundation Volatility Framework 2.3.1
$ cat dll-03.lst | wc -l
397
DLL 목록에서 기준점에 적용하여 검토할 DLL의 수를 37개로 줄일 수 있다. 이는 1,990개를 검토하는 것 보다 효율적이다.
$ cat dll-03.lst dll-baseline-01.lst dll-baseline-01.lst | sort | uniq -iu | wc -l
37
분석에서, uniq 명령의 여러 속성을 활용하여 비교했다. -i 매개 변수는 대소 문자를 무시하도록 사용했다. -u 매개 변수는 uniq에게 고유한 행만 출력하도록 사용했다. 고유성이 dll-03.lst 파일의 내용에 의한 것인지 확인하기 위해, 기준점 파일은 두번 추가하여 사용했다.
37개의 DLL을 검토하는 과정은 합리적으로 보인다. win64dd.exe 하나의 항목만 메모리 수집 프로세스에 의해 소개되었으므로 제거한다. 깨끗한 이미지에서 나온 것이므로 두 목록을 병합하여 DLL에 대한 새로운 기준점을 생성할 수 있다.
$ cat dll-03.lst dll-baseline-01.lst | sort | uniq -i | wc -l
406
$ cat dll-03.lst dll-baseline-01.lst | sort | uniq -i > dll-baseline-02.lst
$ cat dll-baseline-02.lst | wc -l
406
도메인 첨부 메모리 이미지에서 모듈의 개수를 확인하는 과정에서 153개의 모듈이 발견되었다. DLL과 동일한 방법을 사용하여 기준점에 없는 모듈 7개로 좁힐 수 있다. 관리할 수 있는 모듈 수를 조사할 수 있다.
$ vol.py -f win2008r2-03-s1.img modules | cut -c 20-40,60- | grep "0x" | sort | uniq -i | wc -l
Volatility Foundation Volatility Framework 2.3.1
153
$ vol.py -f win2008r2-03-s1.img modules | cut -c 20-40,60- | grep "0x" | sort | uniq -i > module-03.lst
Volatility Foundation Volatility Framework 2.3.1
$ cat module-03.lst | wc -l
153
$ cat module-03.lst module-base-01.lst module-base-01.lst | sort | uniq -iu | wc -l
7
기준점에 없었던 모듈은 아래와 같다. Win64dd.sys는 메모리 수집 프로세스의 아티팩트며 아래에 표시된 것 처럼 기준점에 속하지 않는다. 그 외 모듈은 다음과 같다.
$ cat module-03.lst module-base-01.lst module-base-01.lst | sort | uniq -iu
RDPDD.dll 0x48000 \SystemRoot\System32\RDPDD.dll
rdpdr.sys 0x2e000 \SystemRoot\System32\drivers\rdpdr.sys
RDPWD.SYS 0x39000 \SystemRoot\System32\Drivers\RDPWD.SYS
spsys.sys 0x71000 \SystemRoot\system32\drivers\spsys.sys
tdtcp.sys 0xb000 \SystemRoot\system32\drivers\tdtcp.sys
tssecsrv.sys 0xf000
\SystemRoot\System32\DRIVERS\tssecsrv.sys win64dd.sys 0x11000 \??\C:\temp\windd\win64dd.sys
3.4.3. 네트워크 아티팩트 검토
네트워크 아티팩트 분석은 netscan 플러그인을 사용하여 진행한다.
$ vol.py -f win2008r2-03-s1.img netscan | cut -c 12-18,21-40,50-63,86-112 | sort | uniq -w 20
Volatility Foundation Volatility Framework 2.3.1
Proto Local Address Foreign Addr Pid Owner
TCPv4 0.0.0.0:135 0.0.0.0:0 660 svchost.exe
TCPv4 0.0.0.0:3389 0.0.0.0:0 1412 svchost.exe
TCPv4 0.0.0.0:445 0.0.0.0:0 4 System
TCPv4 0.0.0.0:47001 0.0.0.0:0 4 System
TCPv4 0.0.0.0:49152 0.0.0.0:0 368 wininit.exe
TCPv4 0.0.0.0:49153 0.0.0.0:0 740 svchost.exe
TCPv4 0.0.0.0:49154 0.0.0.0:0 796 svchost.exe
TCPv4 0.0.0.0:49173 0.0.0.0:0 472 services.exe
TCPv4 0.0.0.0:49174 0.0.0.0:0 1472 svchost.exe
TCPv4 0.0.0.0:49178 0.0.0.0:0 480 lsass.exe
TCPv4 -:0 24.217.239.1 480 lsass.exe
TCPv4 192.168.139.102:139 0.0.0.0:0 4 System
TCPv6 -:0 18d9:ef0d:80:ffff:0 CLOSED 48
TCPv6 :::135 :::0 660 svchost.exe
TCPv6 :::3389 :::0 1412 svchost.exe
TCPv6 :::445 :::0 4 System
TCPv6 :::47001 :::0 4 System
TCPv6 :::49152 :::0 368 wininit.exe
TCPv6 :::49153 :::0 740 svchost.exe
TCPv6 :::49154 :::0 796 svchost.exe
TCPv6 :::49173 :::0 472 services.exe
TCPv6 :::49174 :::0 1472 svchost.exe
TCPv6 :::49178 :::0 480 lsass.exe
UDPv4 0.0.0.0:0 *:* 1472 svchost.exe
UDPv4 0.0.0.0:123 *:* 848 svchost.exe
UDPv4 0.0.0.0:4500 *:* 796 svchost.exe
UDPv4 0.0.0.0:500 *:* 796 svchost.exe
UDPv4 0.0.0.0:5355 *:* 932 svchost.exe
UDPv4 127.0.0.1:57762 *:* 480 lsass.exe
UDPv4 127.0.0.1:65282 *:* 796 svchost.exe
UDPv4 192.168.139.102:137 *:* 4 System
UDPv6 :::0 *:* 1472 svchost.exe
UDPv6 :::123 *:* 848 svchost.exe
UDPv6 :::4500 *:* 796 svchost.exe
UDPv6 :::500 *:* 796 svchost.exe
UDPv6 :::5355 *:* 932 svchost.exe
netscan의 결과를 기준으로 기준점과 비교해 보면 세 가지로 구분할 수 있다.
- 포트는 일반 포트,
- 서버가 도메인에 연결되어 있지 않을 때 사용되는 포트 그리고
- 서버가 도메인에 연결될 때 사용되는 포트로 나눌 수 있다.
이러한 내용은 표 6에 요약되어 있다. 이 목록의 유효성을 검사하기 위해 IIS 서버, 도메인 컨트롤러 그리고 SQL 서버를 포함한 추가 구성을 사용하는 추가 작업이 필요하다.
기준점에서 네트워크 포트를 사용할 때 주의할 점이 있다. 동적 포트 범위의 포트를 찾을 때 다른 프로세스가 이미 포트를 사용하고 있는 경우, 다른 서버 구성에 따라 동적 포트가 할당될 수 있다.
4. 결론
이 문서는 메모리 분석을 위한 기준점을 구축하는 방법을 설명했다. 이 방법은 시작일 뿐이다. 추가로 다른 Windows Server 2008 R2 구성을 사용하여 유효성을 검사하고 빌드하려면 더 많은 작업을 수행해야 한다. 유사한 방법을 사용하여 Windows 7, Windows 8 그리고 Windows Server 2012을 위한 기준점을 구축할 수 있다.
기준점의 가치는 빌딩과 테스트하는 과정에서 입증되었다. 예상되는 프로세스를 문서화하여 기준점에 없지만 있어야 했던 프로세스를 신속하게 식별할 수 있었다. 예기치 않은 시스템을 식별하기 위해 손상된 시스템의 메모리 이미지에 기준점을 쉽게 사용할 수 있다. 이를 통해 찾은 프로세스와 DLL 목록으로 의심스러운 프로세스에 신속하게 집중할 수 있다. 기준점의 사용 가치는 검사할 DLL을 1,990개에서 37개로 줄이고 검사할 모듈을 153개에서 7개의 줄여 훨씬 더 효율적임을 증명한 것에 있다.
일반적으로 기준점은 여러 소스의 메모리 이미지를 일반적으로 분석하는 것에 유용할 수 있다. 조직의 경우 표준 구성으로 맞춘 기준점을 사용하면 분석에 많은 시간을 절약할 수 있다. VMware Workstation에서 서버를 구현함으로써 생성된 아티팩트가 기준점에 영향을 주는 것을 확인했다. 이러한 확인을 확장하여 안티 바이러스 소프트웨어와 같은 조직의 표준 구성에 대해 다른 아티팩트를 생각해야 한다. 따라서 이러한 형태의 아티팩트를 기준점에 설정하면 분석에 상당한 시간을 절약할 수 있다.
5. 참고 자료
- IANA. (2014). Service Name and Transport Protocol Port Number Registry. Retrieved August 3, 2014 from http://www.iana.org/assignments/service-names-portnumbers/service-names-port-numbers.xhtml.
- Lee, Rob & Tilbury, Chad. (2013). Incident Response and Memory Analysis. The SANS Institute.
- Ligh, Michael Hale, Case, Andrew, Levy, Andrew, and Walters, Aaron. (2014). The Art of Memory Forensics. Indianapolis, ID: Wiley.
- Microsoft Developer Network. (2014). Obtaining Data from the Local Computer. Retrieved August 3, 2014 from http://msdn.microsoft.com/enus/library/aa384424(v=vs.85).aspx.
- Microsoft Knowledge Base (2013a). Well-known security identifiers in Windows Operating Systems, Article ID: 243330. Retrieved July 27, 2014 from http://support.microsoft.com/kb/243330.
- Microsoft Knowledge Base (2013b). Service overview and network port requirements for Windows, Article ID: 832017. Retrieved July 27, 2014 from http://support.microsoft.com/kb/832017.
- Microsoft Knowledge Base (2013c). The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008, Article ID: 929851. Retrieved July 27, 2014 from http://support.microsoft.com/kb/929851.
- Olsen, Patrick. (2014). Know your Windows Processes or Die Trying. Retrieved July 30, 2014 from http://sysforensics.org/2014/01/know-your-windowsprocesses.html.
- Pilkington, Mike & Lee, Rob. (2014). SANS DFIR Digital Forensic & Incident Response Poster, Spring 2014, 29th Edition. The SANS Institute.
- Russinovich, Mark, Solomon, David A., and Ionsecu, Alex. (2012a). Windows Internals. 6th Edition, Part 1. Redmond, WA: Microsoft Press.
- Russinovich, Mark, Solomon, David A., and Ionsecu, Alex. (2012b). Windows Internals. 6th Edition, Part 2. Redmond, WA: Microsoft Press.
- The Cable Guy. (2006, November). Link-Local Multicast Name Resolution. Retrieved August 3, 2014 from http://technet.microsoft.com/library/bb878128.
- VMware. (2011) vSphere Virtual Machine Administration Guide. Palo Alto, CA: VMware, Inc.
- VMware Knowledge Base. (2014, June 24). Processes started by the View Agent and View Client (1015677). Retrieved July 27, 2104 from http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1015677.
- Startup Programs Database. (2014a). TrustedInstaller.exe Information. Retrieved August 2, 2014 from http://www.bleepingcomputer.com/startups/TrustedInstaller.exe-25809.html.
- Startup Programs Database. (2014b). Sppsvc.exe Information. Retrieved August 2, 2014 from http://www.bleepingcomputer.com/startups/sppsvc.exe-25807.html.
- Startup Programs Database. (2014c). Dllhost.exe Information. Retrieved August 2, 2014 from http://www.bleepingcomputer.com/startups/dllhost.exe-25641.html.
- Startup Programs Database. (2014d). Msdtc.exe Information. Retrieved August 2, 2014 from http://www.bleepingcomputer.com/startups/msdtc.exe-3339.html.
- Startup Programs Database. (2014e). spoolsv.exe Information. Retrieved August 2, 2014 from http://www.bleepingcomputer.com/startups/spoolsv.exe-25571.html.
- Volatility Wiki. (2013). Volatility 2.3: Volatility Basic Usage. Retrieved August 9, 2014 from http://code.google.com/p/volatility/wiki/VolatilityUsage23.