SlideShare a Scribd company logo
1 of 40
Download to read offline
SangJun Jeon
heros86@korea.ac.kr
DFRC@Korea University
HFS+ File system
2/40
HFS+ File System
HFS+
File System
3/40
HFS+ File System
• HFS Filesystem
UFS 기반으로 제작한 파일 시스템
저널링을 제공하지 않음
파일 이름 길이 제한(255자)
큰 용량 데이터 처리 문제가 존재
• HFS+ Filesystem
Mac OS X를 위해 개발한 파일시스템
디스크 및 CD-ROM에서도 사용할 수 있도록 구성
HFS 파일시스템의 단점을 보완
4/40
Raw 이미지 획득
• MAC OS X는 Target Disk Mode를 가지고 있음
FireWire로 두 시스템을 연결
Mac OS X의 auto mount 데몬을 종료하고 수행
• /usr/sbin/diskarbitrationd
타겟 시스템을 T를 누른 채로 부팅
• Target Disk Mode
• Support to Mac OS X or OS8/OS9
FireWire를 이용한 디스크 이미징
5/40
Raw 이미지 획득
• Net cat 을 이용한 DD 이미지 전송
XP (서버측 설정)
• 12345 포트 Open
• >nc -w 10 -Lvp 12345 > Mac.dd
Mac (Client측 명령)
• $sudo dd if=/dev/disk1 bs=1024 | nc 163.152.165.109 12345
6/40
• 이미지 정상 여부 판단
Sleuthkit 3.1.0 버전 hfs 지원
올바른 이미지가 확보되었는지 판단하기 위해 sleuth kit 이용.
• 인식 에러
• 볼륨이 아닌 disk를 이미징 한 결과
Raw 이미지 획득
7/40
• EFI Disk label 제거
FTK Imager등을 이용, HFS+ Volume만 이미징
HFS+ Volume
Raw 이미지 획득
8/40
Basic Structure
Smartphone Forensics(iPhone)
9/40
• 기본구조
Reserved (1024 bytes)
Volume Header
data
Allocation File
data
Extents overflow File
data
Catalog File
data
Attributes File
data
Startup File
data
Alternate Volume header
Rerserved (512 bytes)
-원래 Boot Block이 들어가던 자리. OS의 발달
로 Boot 블록이 필요치 않게 되었다
-Mac OS Finder가 시스템 폴더가 변경되게 되
면 이곳에 변경 내용을 작성한다.
HFS+ Signature, 볼륨 날짜 정보, 블록정보, 파이
/폴더의 개수, Catalog file의 위치 정보ㅡ 저널
블록 정보를 가진다.
블록에 대한 flag 값을 통해 비트맵 형식의 관리
하나의 Fork가 값을 모두 담지 못할 경우 이곳에
데이터를 저장.
파일 / 폴더의 정보를 가짐. B-Tree형식
최초 분석 대상
부팅을 위해 사용됨.
B-Tree에 관한 속성정보 (노드 크기 등)
Volume header의 백업
HFS+ 구조
10/40
• Volume Header
struct HFSPlusVolumeHeader {
UInt16 signature; //2byte
UInt16 version; //2byte
UInt32 attributes; //4byte
UInt32 lastMountedVersion; //4byte
UInt32 journalInfoBlock; //4byte
UInt32 createDate; //4byte
UInt32 modifyDate; //4byte
UInt32 backupDate; //4byte
UInt32 checkedDate; //4byte
UInt32 fileCount; //4byte
UInt32 folderCount; //4byte
UInt32 blockSize; //4byte
UInt32 totalBlocks; //4byte
UInt32 freeBlocks; //4byte
UInt32 nextAllocation; //4byte
UInt32 rsrcClumpSize; //4byte
UInt32 dataClumpSize; //4byte
HFSCatalogNodeID nextCatalogID; //4byte
UInt32 writeCount; //4byte
UInt64 encodingsBitmap; //8byte
UInt32 finderInfo[8]; //32byte
HFSPlusForkData allocationFile; //80byte
HFSPlusForkData extentsFile; //80byte
HFSPlusForkData catalogFile; //80byte
HFSPlusForkData attributesFile; //80byte
HFSPlusForkData startupFile; //80byte
}; typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
HFS+ 구조
11/40
• HFSPlusForkData 구조체
struct HFSPlusForkData {
UInt64 logicalSize; //8byte
UInt32 clumpSize; //4byte
UInt32 totalBlocks; //4byte
HFSPlusExtentDescriptor extents; //64byte
}; typedef struct HFSPlusForkData HFSPlusForkData; //80byte
HFS+ 구조
112byte data
Allocation File(80byte)
Extents File(80byte)
Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte)
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Attributes File(80byte)
Startup File(80byte)
12/40
• HFSPlusExtentDescriptor 구조체
typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; //8byte
struct HFSPlusExtentDescriptor {
UInt32 startBlock; //4byte
UInt32 blockCount; //4byte
}; typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
HFS+ 구조
112byte data
Allocation File(80byte)
Extents File(80byte)
Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte)
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Attributes File(80byte)
Startup File(80byte)
13/40
• Volume Header
112byte data
Allocation File(80byte)
Extents File(80byte)
Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte)
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Attributes File(80byte)
Startup File(80byte)
HFSPlusExtentDescriptor 구조체
HFSPlusForkData 구조체
HFS+ 구조
14/40
• HFS+ Volume Header
112byte data
Allocation File(80byte)
Extents File(80byte)
Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte)
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Start Block Block Count Start Block Block Count
Attributes File(80byte)
Startup File(80byte)
$CatalogFile 속성
HFS+ 구조
15/40
• Catalog File 기본 구조
First leafnode pointer Root node pointer Last leaf node pointer
8 pointer 16 pointer
16 pointer 20 pointer 23 pointer
13 data8 data 10 data 20 data 21 data 23 data
8 pointer 13 pointer
16 data
Header Node
Index Node
Index Node
Leaf Node
HFS+ 구조
16/40
Catalog File
Smartphone Forensics(iPhone)
17/40
• HFS+ Volume Header
$CatalogFile 속성
Logical block Clump size Total Blocks
Start Block Num of Block
Catalog File(Find Root Node)
18/40
• Find catalog header
(Volume headercatalogfilestartblock) * (Volume headerblocksize) = catalog header offset
• Volume Header
Block Size = Offset 41~44
CatalogFile attribute = offset 273~352
Block Size
Start Block
0x1000 * 0x8678 = 0x8678000
Catalog File(Find Root Node)
19/40
• File Header
Reserved Area(14 Byte)
Header
…
…
…
…
…
Catalog File(B-tree)
20/40
• Header
Depth
Root Node leafRecords firstLeafNode
lastLeafNode
Node Size
maxKeyLen TotalNodes freeNodes
Catalog File(Find Root Node)
21/40
• Find root node
Root Node
Node Size
0xEE * 0x2000 = 0x1DC000
0x8678000 + 0x1DC000 = 0x8854000
Catalog File(Find Root Node)
22/40
• The Root Node
Smartphone Forensics(iPhone)
Catalog File(Find Root Node)
23/40
• Node Structure (Index & Leaf node)
Node descriptor
Record 0
Record 1
Free Space
Offset to free space
Offset to record 1
Offset to record 0
Value kind
-1 Leaf node
0 Index node
1 Header node
2 Map node
Catalog File(Root Node)
24/40
• Node Structure sample
Node Descriptor of root node
flink blink type
height
Num of Record
reserved
Catalog File(Root Node)
25/40
• Index node
Offset to Record’n’ = node[nodesize - (n + 1) * 2];
… Offset to record 0Offset to record 1
Key length
Parent Node Id Key name length
Key name
Child pointer
Catalog File(Root Node)
26/40
• Leaf node
…
…
Offset to record 0Offset to record 1
flink
Record type
Value kind
1 Forder
2 FileParent Node Id
Key name lengthKey length
Catalog File(Root Node)
27/40
Catalog File (Node Traverse)
• Find root node
Index node or leaf node
Traverse start!
• Index node일 경우
Record 조사
Next node = child node(pointer)
• Leaf node일 경우
Record 조사
Next node = next leaf node(flink)
28/40
• Node Traverse
• Index Node 가 POP 된 경우
PUSH all child node
• Leaf Node 가 POP 된 경우
Read Record
0
2
1
4
3
2
7
6
5
4
3
9
8
7
6
5
4
10
9
8
7
6
5
11
10
9
8
7
6
13
12
11
10
9
8
7
14
13
12
11
10
9
8
14
13
12
11
10
9
…
POP 0 POP 1 POP 2 POP 3 POP 04 POP 5 POP 6 POP 7 POP 9
0
1 2
3 4 5 6 7
8 9 10 11 12 13 14
QUEUE flow:
Catalog File (Node Traverse)
29/40
Data Extract
Smartphone Forensics(iPhone)
30/40
Data Extract
• 데이터 추출 (by CNID)
Leaf record
…
…
Offset to record 0Offset to record 1
flink
Record type
Value kind
1 Forder
2 FileParent Node Id
Key name lengthKey length
31/40
• 데이터 추출 (by CNID)
Leaf record
88 byte
Data Extract
32/40
• 데이터 추출
Sleuthkit – icat
Data Extract
33/40
Deleted File
Smartphone Forensics(iPhone)
34/40
• 추출 파일
Cdto_2.3.zip cnid = 341343
FilenoriSetup.exe  cnid = 343124
PurpGuy.gif  cnid = 80970
스택에 관하여.pdf  cnid = 340109
대상 데이터
35/40
• Cdto_2.3.zip cnid = 341343
 Record
 Data
결과 확인
36/40
• FilenoriSetup.exe  cnid = 343124
Record
Data
결과 확인
37/40
• PurpGuy.gif  cnid = 80970
Record
Data
결과 확인
38/40
• 스택에 관하여.pdf  cnid = 340109 (휴지통)
 Record
 Data
결과 확인
39/40
• 파일 삭제 후 재 이미징
삭제 여부
• 삭제 : Cdto_2.3.zip , FilenoriSetup.exe , PurpGuy.gif
• 휴지통 : 스택에 관하여.pdf
삭제 후
• 파일 data 영역
 다음 파일 덮어 씌워짐
(Cdto_2.3.zip , FilenoriSetup.exe )
다음 파일 데이터 남아 있음
(PurpGuy.gif, 스택에 관하여.pdf)
• Node record 영역
 전부 제거된 상태
 Catalog File 내의 트리 구조 재구성으로 인해 메타 데이터 영역이 남아있는 경우가 드묾
따라서, 저널 파일을 이용한 복원 혹은 카빙을 이용한 복원 방법만을 사용 가능
결과 확인
40/40
질문 및 답변
Smartphone Forensics(iPhone)

More Related Content

Similar to (120804) #fitalk advanced mac os forensics (hfs+ filesystem)

리눅스 소켓 프로그래밍 기초
리눅스 소켓 프로그래밍 기초리눅스 소켓 프로그래밍 기초
리눅스 소켓 프로그래밍 기초Yu Yongwoo
 
(120513) #fitalk a dig into the $log file
(120513) #fitalk   a dig into the $log file(120513) #fitalk   a dig into the $log file
(120513) #fitalk a dig into the $log fileINSIGHT FORENSIC
 
백업을 위한 USB운영체제 완료세미나
백업을 위한 USB운영체제 완료세미나백업을 위한 USB운영체제 완료세미나
백업을 위한 USB운영체제 완료세미나Daniel Shin
 
2006 03 15_pe & api hook
2006 03 15_pe & api hook2006 03 15_pe & api hook
2006 03 15_pe & api hook용환 노
 
log-monitoring-architecture.pdf
log-monitoring-architecture.pdflog-monitoring-architecture.pdf
log-monitoring-architecture.pdfSungkyun Kim
 
(120107) #fitalk mft and indx slacks
(120107) #fitalk   mft and indx slacks(120107) #fitalk   mft and indx slacks
(120107) #fitalk mft and indx slacksINSIGHT FORENSIC
 
sqlserver7.0 데이타베이스
sqlserver7.0 데이타베이스sqlserver7.0 데이타베이스
sqlserver7.0 데이타베이스영빈 송
 
[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)NAVER D2
 
(150124) #fitalk advanced $usn jrnl forensics (korean)
(150124) #fitalk   advanced $usn jrnl forensics (korean)(150124) #fitalk   advanced $usn jrnl forensics (korean)
(150124) #fitalk advanced $usn jrnl forensics (korean)INSIGHT FORENSIC
 
그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조Choonghyun Yang
 
리눅스 커널 기초 태스크관리
리눅스 커널 기초 태스크관리리눅스 커널 기초 태스크관리
리눅스 커널 기초 태스크관리Seungyong Lee
 
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
Linux Kernel Boot Process , SOSCON 2015, By Mario ChoLinux Kernel Boot Process , SOSCON 2015, By Mario Cho
Linux Kernel Boot Process , SOSCON 2015, By Mario ChoMario Cho
 
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드Apache Tomcat ( 아파치 톰캣 ) 설치 가이드
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드Opennaru, inc.
 
(120128) #fitalk sql server anti-forensics
(120128) #fitalk   sql server anti-forensics(120128) #fitalk   sql server anti-forensics
(120128) #fitalk sql server anti-forensicsINSIGHT FORENSIC
 
Linux programming study
Linux programming studyLinux programming study
Linux programming studyYunseok Lee
 
포렌식 세미나.pptx
포렌식 세미나.pptx포렌식 세미나.pptx
포렌식 세미나.pptxdalonn
 
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]Ch01 네트워크와+소켓+프로그래밍+[호환+모드]
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]지환 김
 
Linux Kernel 101 for Beginner
Linux Kernel 101 for BeginnerLinux Kernel 101 for Beginner
Linux Kernel 101 for BeginnerInfraEngineer
 
Buffer Overflow PPT (OneTwo)
Buffer Overflow PPT (OneTwo)Buffer Overflow PPT (OneTwo)
Buffer Overflow PPT (OneTwo)one_two_12
 

Similar to (120804) #fitalk advanced mac os forensics (hfs+ filesystem) (20)

리눅스 소켓 프로그래밍 기초
리눅스 소켓 프로그래밍 기초리눅스 소켓 프로그래밍 기초
리눅스 소켓 프로그래밍 기초
 
(120513) #fitalk a dig into the $log file
(120513) #fitalk   a dig into the $log file(120513) #fitalk   a dig into the $log file
(120513) #fitalk a dig into the $log file
 
백업을 위한 USB운영체제 완료세미나
백업을 위한 USB운영체제 완료세미나백업을 위한 USB운영체제 완료세미나
백업을 위한 USB운영체제 완료세미나
 
2006 03 15_pe & api hook
2006 03 15_pe & api hook2006 03 15_pe & api hook
2006 03 15_pe & api hook
 
log-monitoring-architecture.pdf
log-monitoring-architecture.pdflog-monitoring-architecture.pdf
log-monitoring-architecture.pdf
 
Network researching
Network researchingNetwork researching
Network researching
 
(120107) #fitalk mft and indx slacks
(120107) #fitalk   mft and indx slacks(120107) #fitalk   mft and indx slacks
(120107) #fitalk mft and indx slacks
 
sqlserver7.0 데이타베이스
sqlserver7.0 데이타베이스sqlserver7.0 데이타베이스
sqlserver7.0 데이타베이스
 
[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)
 
(150124) #fitalk advanced $usn jrnl forensics (korean)
(150124) #fitalk   advanced $usn jrnl forensics (korean)(150124) #fitalk   advanced $usn jrnl forensics (korean)
(150124) #fitalk advanced $usn jrnl forensics (korean)
 
그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조
 
리눅스 커널 기초 태스크관리
리눅스 커널 기초 태스크관리리눅스 커널 기초 태스크관리
리눅스 커널 기초 태스크관리
 
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
Linux Kernel Boot Process , SOSCON 2015, By Mario ChoLinux Kernel Boot Process , SOSCON 2015, By Mario Cho
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
 
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드Apache Tomcat ( 아파치 톰캣 ) 설치 가이드
Apache Tomcat ( 아파치 톰캣 ) 설치 가이드
 
(120128) #fitalk sql server anti-forensics
(120128) #fitalk   sql server anti-forensics(120128) #fitalk   sql server anti-forensics
(120128) #fitalk sql server anti-forensics
 
Linux programming study
Linux programming studyLinux programming study
Linux programming study
 
포렌식 세미나.pptx
포렌식 세미나.pptx포렌식 세미나.pptx
포렌식 세미나.pptx
 
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]Ch01 네트워크와+소켓+프로그래밍+[호환+모드]
Ch01 네트워크와+소켓+프로그래밍+[호환+모드]
 
Linux Kernel 101 for Beginner
Linux Kernel 101 for BeginnerLinux Kernel 101 for Beginner
Linux Kernel 101 for Beginner
 
Buffer Overflow PPT (OneTwo)
Buffer Overflow PPT (OneTwo)Buffer Overflow PPT (OneTwo)
Buffer Overflow PPT (OneTwo)
 

More from INSIGHT FORENSIC

(160820) #fitalk fileless malware forensics
(160820) #fitalk    fileless malware forensics(160820) #fitalk    fileless malware forensics
(160820) #fitalk fileless malware forensicsINSIGHT FORENSIC
 
(150124) #fitalk advanced $usn jrnl forensics (english)
(150124) #fitalk   advanced $usn jrnl forensics (english)(150124) #fitalk   advanced $usn jrnl forensics (english)
(150124) #fitalk advanced $usn jrnl forensics (english)INSIGHT FORENSIC
 
(140118) #fitalk detection of anti-forensics artifacts using ioa fs
(140118) #fitalk   detection of anti-forensics artifacts using ioa fs(140118) #fitalk   detection of anti-forensics artifacts using ioa fs
(140118) #fitalk detection of anti-forensics artifacts using ioa fsINSIGHT FORENSIC
 
(140118) #fitalk 2013 e-discovery trend
(140118) #fitalk   2013 e-discovery trend(140118) #fitalk   2013 e-discovery trend
(140118) #fitalk 2013 e-discovery trendINSIGHT FORENSIC
 
(141031) #fitalk plaso 슈퍼 타임라인 분석 도구 활용 방안
(141031) #fitalk   plaso 슈퍼 타임라인 분석 도구 활용 방안(141031) #fitalk   plaso 슈퍼 타임라인 분석 도구 활용 방안
(141031) #fitalk plaso 슈퍼 타임라인 분석 도구 활용 방안INSIGHT FORENSIC
 
(141031) #fitalk os x yosemite artifacts
(141031) #fitalk   os x yosemite artifacts(141031) #fitalk   os x yosemite artifacts
(141031) #fitalk os x yosemite artifactsINSIGHT FORENSIC
 
(140716) #fitalk 전자금융사고에서의 디지털 포렌식
(140716) #fitalk   전자금융사고에서의 디지털 포렌식(140716) #fitalk   전자금융사고에서의 디지털 포렌식
(140716) #fitalk 전자금융사고에서의 디지털 포렌식INSIGHT FORENSIC
 
(140716) #fitalk digital evidence from android-based smartwatch
(140716) #fitalk   digital evidence from android-based smartwatch(140716) #fitalk   digital evidence from android-based smartwatch
(140716) #fitalk digital evidence from android-based smartwatchINSIGHT FORENSIC
 
(140625) #fitalk sq lite 소개와 구조 분석
(140625) #fitalk   sq lite 소개와 구조 분석(140625) #fitalk   sq lite 소개와 구조 분석
(140625) #fitalk sq lite 소개와 구조 분석INSIGHT FORENSIC
 
(140407) #fitalk d trace를 이용한 악성코드 동적 분석
(140407) #fitalk   d trace를 이용한 악성코드 동적 분석(140407) #fitalk   d trace를 이용한 악성코드 동적 분석
(140407) #fitalk d trace를 이용한 악성코드 동적 분석INSIGHT FORENSIC
 
(140625) #fitalk sq lite 삭제된 레코드 복구 기법
(140625) #fitalk   sq lite 삭제된 레코드 복구 기법(140625) #fitalk   sq lite 삭제된 레코드 복구 기법
(140625) #fitalk sq lite 삭제된 레코드 복구 기법INSIGHT FORENSIC
 
(130216) #fitalk reverse connection tool analysis
(130216) #fitalk   reverse connection tool analysis(130216) #fitalk   reverse connection tool analysis
(130216) #fitalk reverse connection tool analysisINSIGHT FORENSIC
 
(130216) #fitalk potentially malicious ur ls
(130216) #fitalk   potentially malicious ur ls(130216) #fitalk   potentially malicious ur ls
(130216) #fitalk potentially malicious ur lsINSIGHT FORENSIC
 
(130202) #fitalk trends in d forensics (jan, 2013)
(130202) #fitalk   trends in d forensics (jan, 2013)(130202) #fitalk   trends in d forensics (jan, 2013)
(130202) #fitalk trends in d forensics (jan, 2013)INSIGHT FORENSIC
 
(130202) #fitalk china threat
(130202) #fitalk   china threat(130202) #fitalk   china threat
(130202) #fitalk china threatINSIGHT FORENSIC
 
(130119) #fitalk apt, cyber espionage threat
(130119) #fitalk   apt, cyber espionage threat(130119) #fitalk   apt, cyber espionage threat
(130119) #fitalk apt, cyber espionage threatINSIGHT FORENSIC
 
(130119) #fitalk all about physical data recovery
(130119) #fitalk   all about physical data recovery(130119) #fitalk   all about physical data recovery
(130119) #fitalk all about physical data recoveryINSIGHT FORENSIC
 
(130105) #fitalk trends in d forensics (dec, 2012)
(130105) #fitalk   trends in d forensics (dec, 2012)(130105) #fitalk   trends in d forensics (dec, 2012)
(130105) #fitalk trends in d forensics (dec, 2012)INSIGHT FORENSIC
 
(130105) #fitalk criminal civil judicial procedure in korea
(130105) #fitalk   criminal civil judicial procedure in korea(130105) #fitalk   criminal civil judicial procedure in korea
(130105) #fitalk criminal civil judicial procedure in koreaINSIGHT FORENSIC
 
(131116) #fitalk extracting user typing history on bash in mac os x memory
(131116) #fitalk   extracting user typing history on bash in mac os x memory(131116) #fitalk   extracting user typing history on bash in mac os x memory
(131116) #fitalk extracting user typing history on bash in mac os x memoryINSIGHT FORENSIC
 

More from INSIGHT FORENSIC (20)

(160820) #fitalk fileless malware forensics
(160820) #fitalk    fileless malware forensics(160820) #fitalk    fileless malware forensics
(160820) #fitalk fileless malware forensics
 
(150124) #fitalk advanced $usn jrnl forensics (english)
(150124) #fitalk   advanced $usn jrnl forensics (english)(150124) #fitalk   advanced $usn jrnl forensics (english)
(150124) #fitalk advanced $usn jrnl forensics (english)
 
(140118) #fitalk detection of anti-forensics artifacts using ioa fs
(140118) #fitalk   detection of anti-forensics artifacts using ioa fs(140118) #fitalk   detection of anti-forensics artifacts using ioa fs
(140118) #fitalk detection of anti-forensics artifacts using ioa fs
 
(140118) #fitalk 2013 e-discovery trend
(140118) #fitalk   2013 e-discovery trend(140118) #fitalk   2013 e-discovery trend
(140118) #fitalk 2013 e-discovery trend
 
(141031) #fitalk plaso 슈퍼 타임라인 분석 도구 활용 방안
(141031) #fitalk   plaso 슈퍼 타임라인 분석 도구 활용 방안(141031) #fitalk   plaso 슈퍼 타임라인 분석 도구 활용 방안
(141031) #fitalk plaso 슈퍼 타임라인 분석 도구 활용 방안
 
(141031) #fitalk os x yosemite artifacts
(141031) #fitalk   os x yosemite artifacts(141031) #fitalk   os x yosemite artifacts
(141031) #fitalk os x yosemite artifacts
 
(140716) #fitalk 전자금융사고에서의 디지털 포렌식
(140716) #fitalk   전자금융사고에서의 디지털 포렌식(140716) #fitalk   전자금융사고에서의 디지털 포렌식
(140716) #fitalk 전자금융사고에서의 디지털 포렌식
 
(140716) #fitalk digital evidence from android-based smartwatch
(140716) #fitalk   digital evidence from android-based smartwatch(140716) #fitalk   digital evidence from android-based smartwatch
(140716) #fitalk digital evidence from android-based smartwatch
 
(140625) #fitalk sq lite 소개와 구조 분석
(140625) #fitalk   sq lite 소개와 구조 분석(140625) #fitalk   sq lite 소개와 구조 분석
(140625) #fitalk sq lite 소개와 구조 분석
 
(140407) #fitalk d trace를 이용한 악성코드 동적 분석
(140407) #fitalk   d trace를 이용한 악성코드 동적 분석(140407) #fitalk   d trace를 이용한 악성코드 동적 분석
(140407) #fitalk d trace를 이용한 악성코드 동적 분석
 
(140625) #fitalk sq lite 삭제된 레코드 복구 기법
(140625) #fitalk   sq lite 삭제된 레코드 복구 기법(140625) #fitalk   sq lite 삭제된 레코드 복구 기법
(140625) #fitalk sq lite 삭제된 레코드 복구 기법
 
(130216) #fitalk reverse connection tool analysis
(130216) #fitalk   reverse connection tool analysis(130216) #fitalk   reverse connection tool analysis
(130216) #fitalk reverse connection tool analysis
 
(130216) #fitalk potentially malicious ur ls
(130216) #fitalk   potentially malicious ur ls(130216) #fitalk   potentially malicious ur ls
(130216) #fitalk potentially malicious ur ls
 
(130202) #fitalk trends in d forensics (jan, 2013)
(130202) #fitalk   trends in d forensics (jan, 2013)(130202) #fitalk   trends in d forensics (jan, 2013)
(130202) #fitalk trends in d forensics (jan, 2013)
 
(130202) #fitalk china threat
(130202) #fitalk   china threat(130202) #fitalk   china threat
(130202) #fitalk china threat
 
(130119) #fitalk apt, cyber espionage threat
(130119) #fitalk   apt, cyber espionage threat(130119) #fitalk   apt, cyber espionage threat
(130119) #fitalk apt, cyber espionage threat
 
(130119) #fitalk all about physical data recovery
(130119) #fitalk   all about physical data recovery(130119) #fitalk   all about physical data recovery
(130119) #fitalk all about physical data recovery
 
(130105) #fitalk trends in d forensics (dec, 2012)
(130105) #fitalk   trends in d forensics (dec, 2012)(130105) #fitalk   trends in d forensics (dec, 2012)
(130105) #fitalk trends in d forensics (dec, 2012)
 
(130105) #fitalk criminal civil judicial procedure in korea
(130105) #fitalk   criminal civil judicial procedure in korea(130105) #fitalk   criminal civil judicial procedure in korea
(130105) #fitalk criminal civil judicial procedure in korea
 
(131116) #fitalk extracting user typing history on bash in mac os x memory
(131116) #fitalk   extracting user typing history on bash in mac os x memory(131116) #fitalk   extracting user typing history on bash in mac os x memory
(131116) #fitalk extracting user typing history on bash in mac os x memory
 

(120804) #fitalk advanced mac os forensics (hfs+ filesystem)

  • 3. 3/40 HFS+ File System • HFS Filesystem UFS 기반으로 제작한 파일 시스템 저널링을 제공하지 않음 파일 이름 길이 제한(255자) 큰 용량 데이터 처리 문제가 존재 • HFS+ Filesystem Mac OS X를 위해 개발한 파일시스템 디스크 및 CD-ROM에서도 사용할 수 있도록 구성 HFS 파일시스템의 단점을 보완
  • 4. 4/40 Raw 이미지 획득 • MAC OS X는 Target Disk Mode를 가지고 있음 FireWire로 두 시스템을 연결 Mac OS X의 auto mount 데몬을 종료하고 수행 • /usr/sbin/diskarbitrationd 타겟 시스템을 T를 누른 채로 부팅 • Target Disk Mode • Support to Mac OS X or OS8/OS9 FireWire를 이용한 디스크 이미징
  • 5. 5/40 Raw 이미지 획득 • Net cat 을 이용한 DD 이미지 전송 XP (서버측 설정) • 12345 포트 Open • >nc -w 10 -Lvp 12345 > Mac.dd Mac (Client측 명령) • $sudo dd if=/dev/disk1 bs=1024 | nc 163.152.165.109 12345
  • 6. 6/40 • 이미지 정상 여부 판단 Sleuthkit 3.1.0 버전 hfs 지원 올바른 이미지가 확보되었는지 판단하기 위해 sleuth kit 이용. • 인식 에러 • 볼륨이 아닌 disk를 이미징 한 결과 Raw 이미지 획득
  • 7. 7/40 • EFI Disk label 제거 FTK Imager등을 이용, HFS+ Volume만 이미징 HFS+ Volume Raw 이미지 획득
  • 9. 9/40 • 기본구조 Reserved (1024 bytes) Volume Header data Allocation File data Extents overflow File data Catalog File data Attributes File data Startup File data Alternate Volume header Rerserved (512 bytes) -원래 Boot Block이 들어가던 자리. OS의 발달 로 Boot 블록이 필요치 않게 되었다 -Mac OS Finder가 시스템 폴더가 변경되게 되 면 이곳에 변경 내용을 작성한다. HFS+ Signature, 볼륨 날짜 정보, 블록정보, 파이 /폴더의 개수, Catalog file의 위치 정보ㅡ 저널 블록 정보를 가진다. 블록에 대한 flag 값을 통해 비트맵 형식의 관리 하나의 Fork가 값을 모두 담지 못할 경우 이곳에 데이터를 저장. 파일 / 폴더의 정보를 가짐. B-Tree형식 최초 분석 대상 부팅을 위해 사용됨. B-Tree에 관한 속성정보 (노드 크기 등) Volume header의 백업 HFS+ 구조
  • 10. 10/40 • Volume Header struct HFSPlusVolumeHeader { UInt16 signature; //2byte UInt16 version; //2byte UInt32 attributes; //4byte UInt32 lastMountedVersion; //4byte UInt32 journalInfoBlock; //4byte UInt32 createDate; //4byte UInt32 modifyDate; //4byte UInt32 backupDate; //4byte UInt32 checkedDate; //4byte UInt32 fileCount; //4byte UInt32 folderCount; //4byte UInt32 blockSize; //4byte UInt32 totalBlocks; //4byte UInt32 freeBlocks; //4byte UInt32 nextAllocation; //4byte UInt32 rsrcClumpSize; //4byte UInt32 dataClumpSize; //4byte HFSCatalogNodeID nextCatalogID; //4byte UInt32 writeCount; //4byte UInt64 encodingsBitmap; //8byte UInt32 finderInfo[8]; //32byte HFSPlusForkData allocationFile; //80byte HFSPlusForkData extentsFile; //80byte HFSPlusForkData catalogFile; //80byte HFSPlusForkData attributesFile; //80byte HFSPlusForkData startupFile; //80byte }; typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; HFS+ 구조
  • 11. 11/40 • HFSPlusForkData 구조체 struct HFSPlusForkData { UInt64 logicalSize; //8byte UInt32 clumpSize; //4byte UInt32 totalBlocks; //4byte HFSPlusExtentDescriptor extents; //64byte }; typedef struct HFSPlusForkData HFSPlusForkData; //80byte HFS+ 구조 112byte data Allocation File(80byte) Extents File(80byte) Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte) Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Attributes File(80byte) Startup File(80byte)
  • 12. 12/40 • HFSPlusExtentDescriptor 구조체 typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; //8byte struct HFSPlusExtentDescriptor { UInt32 startBlock; //4byte UInt32 blockCount; //4byte }; typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; HFS+ 구조 112byte data Allocation File(80byte) Extents File(80byte) Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte) Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Attributes File(80byte) Startup File(80byte)
  • 13. 13/40 • Volume Header 112byte data Allocation File(80byte) Extents File(80byte) Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte) Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Attributes File(80byte) Startup File(80byte) HFSPlusExtentDescriptor 구조체 HFSPlusForkData 구조체 HFS+ 구조
  • 14. 14/40 • HFS+ Volume Header 112byte data Allocation File(80byte) Extents File(80byte) Logical Size (8byte) Clump Size (4byte) Total Blocks(4byte) Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Start Block Block Count Attributes File(80byte) Startup File(80byte) $CatalogFile 속성 HFS+ 구조
  • 15. 15/40 • Catalog File 기본 구조 First leafnode pointer Root node pointer Last leaf node pointer 8 pointer 16 pointer 16 pointer 20 pointer 23 pointer 13 data8 data 10 data 20 data 21 data 23 data 8 pointer 13 pointer 16 data Header Node Index Node Index Node Leaf Node HFS+ 구조
  • 17. 17/40 • HFS+ Volume Header $CatalogFile 속성 Logical block Clump size Total Blocks Start Block Num of Block Catalog File(Find Root Node)
  • 18. 18/40 • Find catalog header (Volume headercatalogfilestartblock) * (Volume headerblocksize) = catalog header offset • Volume Header Block Size = Offset 41~44 CatalogFile attribute = offset 273~352 Block Size Start Block 0x1000 * 0x8678 = 0x8678000 Catalog File(Find Root Node)
  • 19. 19/40 • File Header Reserved Area(14 Byte) Header … … … … … Catalog File(B-tree)
  • 20. 20/40 • Header Depth Root Node leafRecords firstLeafNode lastLeafNode Node Size maxKeyLen TotalNodes freeNodes Catalog File(Find Root Node)
  • 21. 21/40 • Find root node Root Node Node Size 0xEE * 0x2000 = 0x1DC000 0x8678000 + 0x1DC000 = 0x8854000 Catalog File(Find Root Node)
  • 22. 22/40 • The Root Node Smartphone Forensics(iPhone) Catalog File(Find Root Node)
  • 23. 23/40 • Node Structure (Index & Leaf node) Node descriptor Record 0 Record 1 Free Space Offset to free space Offset to record 1 Offset to record 0 Value kind -1 Leaf node 0 Index node 1 Header node 2 Map node Catalog File(Root Node)
  • 24. 24/40 • Node Structure sample Node Descriptor of root node flink blink type height Num of Record reserved Catalog File(Root Node)
  • 25. 25/40 • Index node Offset to Record’n’ = node[nodesize - (n + 1) * 2]; … Offset to record 0Offset to record 1 Key length Parent Node Id Key name length Key name Child pointer Catalog File(Root Node)
  • 26. 26/40 • Leaf node … … Offset to record 0Offset to record 1 flink Record type Value kind 1 Forder 2 FileParent Node Id Key name lengthKey length Catalog File(Root Node)
  • 27. 27/40 Catalog File (Node Traverse) • Find root node Index node or leaf node Traverse start! • Index node일 경우 Record 조사 Next node = child node(pointer) • Leaf node일 경우 Record 조사 Next node = next leaf node(flink)
  • 28. 28/40 • Node Traverse • Index Node 가 POP 된 경우 PUSH all child node • Leaf Node 가 POP 된 경우 Read Record 0 2 1 4 3 2 7 6 5 4 3 9 8 7 6 5 4 10 9 8 7 6 5 11 10 9 8 7 6 13 12 11 10 9 8 7 14 13 12 11 10 9 8 14 13 12 11 10 9 … POP 0 POP 1 POP 2 POP 3 POP 04 POP 5 POP 6 POP 7 POP 9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QUEUE flow: Catalog File (Node Traverse)
  • 30. 30/40 Data Extract • 데이터 추출 (by CNID) Leaf record … … Offset to record 0Offset to record 1 flink Record type Value kind 1 Forder 2 FileParent Node Id Key name lengthKey length
  • 31. 31/40 • 데이터 추출 (by CNID) Leaf record 88 byte Data Extract
  • 32. 32/40 • 데이터 추출 Sleuthkit – icat Data Extract
  • 34. 34/40 • 추출 파일 Cdto_2.3.zip cnid = 341343 FilenoriSetup.exe  cnid = 343124 PurpGuy.gif  cnid = 80970 스택에 관하여.pdf  cnid = 340109 대상 데이터
  • 35. 35/40 • Cdto_2.3.zip cnid = 341343  Record  Data 결과 확인
  • 36. 36/40 • FilenoriSetup.exe  cnid = 343124 Record Data 결과 확인
  • 37. 37/40 • PurpGuy.gif  cnid = 80970 Record Data 결과 확인
  • 38. 38/40 • 스택에 관하여.pdf  cnid = 340109 (휴지통)  Record  Data 결과 확인
  • 39. 39/40 • 파일 삭제 후 재 이미징 삭제 여부 • 삭제 : Cdto_2.3.zip , FilenoriSetup.exe , PurpGuy.gif • 휴지통 : 스택에 관하여.pdf 삭제 후 • 파일 data 영역  다음 파일 덮어 씌워짐 (Cdto_2.3.zip , FilenoriSetup.exe ) 다음 파일 데이터 남아 있음 (PurpGuy.gif, 스택에 관하여.pdf) • Node record 영역  전부 제거된 상태  Catalog File 내의 트리 구조 재구성으로 인해 메타 데이터 영역이 남아있는 경우가 드묾 따라서, 저널 파일을 이용한 복원 혹은 카빙을 이용한 복원 방법만을 사용 가능 결과 확인