Enviar pesquisa
Carregar
Windows handle 의 비밀 2
•
9 gostaram
•
7,052 visualizações
Joosaeng Kim
Seguir
Windows Handle 의 비밀 Windows Handle의 역할 및 커널 내부 구조에 대한 여러 실험한 내용을 공유한다.
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 56
Baixar agora
Baixar para ler offline
Recomendados
B tree long
B tree long
Nikhil Sharma
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
United International University
SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic
Aman Patial
5.2 primitive recursive functions
5.2 primitive recursive functions
Sampath Kumar S
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
ScyllaDB
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
用十分鐘 向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計
鍾誠 陳鍾誠
Recomendados
B tree long
B tree long
Nikhil Sharma
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
United International University
SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic
Aman Patial
5.2 primitive recursive functions
5.2 primitive recursive functions
Sampath Kumar S
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
ScyllaDB
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
用十分鐘 向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計
鍾誠 陳鍾誠
Github - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
[若渴]Study on Side Channel Attacks and Countermeasures
[若渴]Study on Side Channel Attacks and Countermeasures
Aj MaChInE
Case Study 1: Linux
Case Study 1: Linux
Munazza-Mah-Jabeen
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
Implementation of FIFO in Linux
Implementation of FIFO in Linux
Tushar B Kute
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
GPUDirect RDMA and Green Multi-GPU Architectures
GPUDirect RDMA and Green Multi-GPU Architectures
inside-BigData.com
git, 이해부터 활용까지
git, 이해부터 활용까지
jylee1229
Applications of queues ii
Applications of queues ii
Tech_MX
heap Sort Algorithm
heap Sort Algorithm
Lemia Algmri
Heap Sort || Heapify Method || Build Max Heap Algorithm
Heap Sort || Heapify Method || Build Max Heap Algorithm
Learning Courses Online
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
ScyllaDB
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
nemoux
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
nemoux
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
nemoux
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
nemoux
윈도우 매니저 스터디: 0.윈도우 매니저 소개
윈도우 매니저 스터디: 0.윈도우 매니저 소개
nemoux
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
nemoux
(NEMO-UX) 미래 컴퓨팅 환경
(NEMO-UX) 미래 컴퓨팅 환경
nemoux
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
zupet
요람(CreateProcess)에서 무덤(ResumeThread)까지
요람(CreateProcess)에서 무덤(ResumeThread)까지
Hyoje Jo
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
Eunhyang Kim
Mais conteúdo relacionado
Mais procurados
Github - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
[若渴]Study on Side Channel Attacks and Countermeasures
[若渴]Study on Side Channel Attacks and Countermeasures
Aj MaChInE
Case Study 1: Linux
Case Study 1: Linux
Munazza-Mah-Jabeen
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
Implementation of FIFO in Linux
Implementation of FIFO in Linux
Tushar B Kute
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
GPUDirect RDMA and Green Multi-GPU Architectures
GPUDirect RDMA and Green Multi-GPU Architectures
inside-BigData.com
git, 이해부터 활용까지
git, 이해부터 활용까지
jylee1229
Applications of queues ii
Applications of queues ii
Tech_MX
heap Sort Algorithm
heap Sort Algorithm
Lemia Algmri
Heap Sort || Heapify Method || Build Max Heap Algorithm
Heap Sort || Heapify Method || Build Max Heap Algorithm
Learning Courses Online
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
ScyllaDB
Mais procurados
(12)
Github - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
[若渴]Study on Side Channel Attacks and Countermeasures
[若渴]Study on Side Channel Attacks and Countermeasures
Case Study 1: Linux
Case Study 1: Linux
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Implementation of FIFO in Linux
Implementation of FIFO in Linux
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
GPUDirect RDMA and Green Multi-GPU Architectures
GPUDirect RDMA and Green Multi-GPU Architectures
git, 이해부터 활용까지
git, 이해부터 활용까지
Applications of queues ii
Applications of queues ii
heap Sort Algorithm
heap Sort Algorithm
Heap Sort || Heapify Method || Build Max Heap Algorithm
Heap Sort || Heapify Method || Build Max Heap Algorithm
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
Destaque
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
nemoux
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
nemoux
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
nemoux
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
nemoux
윈도우 매니저 스터디: 0.윈도우 매니저 소개
윈도우 매니저 스터디: 0.윈도우 매니저 소개
nemoux
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
nemoux
(NEMO-UX) 미래 컴퓨팅 환경
(NEMO-UX) 미래 컴퓨팅 환경
nemoux
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
zupet
Destaque
(8)
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
윈도우 매니저 스터디: 2. 윈도우 매니저 최적화
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
윈도우 매니저 스터디: 3. 윈도우 매니저 입력
윈도우 매니저 스터디: 0.윈도우 매니저 소개
윈도우 매니저 스터디: 0.윈도우 매니저 소개
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
윈도우 매니저 스터디: 1. 윈도우 매니저 출력
(NEMO-UX) 미래 컴퓨팅 환경
(NEMO-UX) 미래 컴퓨팅 환경
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
Semelhante a Windows handle 의 비밀 2
요람(CreateProcess)에서 무덤(ResumeThread)까지
요람(CreateProcess)에서 무덤(ResumeThread)까지
Hyoje Jo
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
Eunhyang Kim
System+os study 1
System+os study 1
Jinkyoung Kim
C# / .NET Framework로 미래 밥그릇을 챙겨보자 (Basic)
C# / .NET Framework로 미래 밥그릇을 챙겨보자 (Basic)
Dong Chan Shin
MFC 발견 (1)
MFC 발견 (1)
종훈 박
내 손에 픽셀을 쥐어다오
내 손에 픽셀을 쥐어다오
KwangSam Kim
만약 운영체제가 없다면? Computer Without OS
만약 운영체제가 없다면? Computer Without OS
ssuser889640
Semelhante a Windows handle 의 비밀 2
(7)
요람(CreateProcess)에서 무덤(ResumeThread)까지
요람(CreateProcess)에서 무덤(ResumeThread)까지
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
WTM 2018 2개월차 신입 백엔드 개발자의 따끈따끈 개발 썰
System+os study 1
System+os study 1
C# / .NET Framework로 미래 밥그릇을 챙겨보자 (Basic)
C# / .NET Framework로 미래 밥그릇을 챙겨보자 (Basic)
MFC 발견 (1)
MFC 발견 (1)
내 손에 픽셀을 쥐어다오
내 손에 픽셀을 쥐어다오
만약 운영체제가 없다면? Computer Without OS
만약 운영체제가 없다면? Computer Without OS
Windows handle 의 비밀 2
1.
Windows Handle 의 비밀 미친감자
김주생 Visual C++ MS MVP 2013년 7월 13일 발표
2.
핸들이 뭐냐?
3.
4.
5.
6.
“System” 이분이 바로 커널
서비스를 해주시는 분이십니다. 안녕하세요~”System”님 보통 “커널”이라고도 하죠~ ㅊ
7.
8.
아..파일이 필요하시다구요 잠시만 기다려주세요.~ 저
커널님아 저 파일좀 하나 만들어주세요~ KERNEL SERVICE LANDUSER LAND
9.
고객님~ 이 핸들만 있으면 파일을
사용하 실 수 있습니다. 자~ 받으세요~! 감사합니다. 커널님아~ 그럼 저는 이 핸들만 있으면 되는 거죠^^? KERNEL SERVICE LANDUSER LAND
10.
파일을 하나 만들었더니.. 핸들을
넘겨줍니다. 핸들에는 어떤 값이 있을 까요? 확인해 봅시다.
11.
7cc 칠씨씨? 뭘까요??
12.
자 이제 칠씨씨의비밀을 알아볼까요^^!!
13.
499 번째 엔트리라는점
14.
프로세스가 만들어지면 이 프로세스가
사용 하는 커널 오브젝트 장부(Table)를 하나 가지고 있다.
15.
프로세스가 생성되면 커널에서는 해당
프로세스를 관리하기 위해 _EPROCESS 에 정보를 저장합니다. 그리고, 핸들정보도 이곳에 있습니다.
16.
_EPROCESS 안에 핸들테이블인 ObjectTable
필드가 있죠^^!?
17.
ObjectTable의 이 값이
의미하는 것은 무엇일까? 음.. 구조체 _HANDLE_TABLE의 주소라는 것~!
18.
구조체 _HANDLE_TABLE에는 각종 핸들테이블
정보가 들어 있습 니다.
19.
바로 이 값이
핸들엔트리가 저장되어 있는 시작 위치 입니다.
20.
Table Code Handle /4 엔트리 크기(8) Table Entry 주소 0xe10b9000
+ 0x7cc/4 * 8 = 0xe10b9f98
21.
4byte Handle Entry 모양~(총
8bytes) 닫 힘 보 호 상 속 가 능 여 부 닫 힘 감 시 여 부 Object Header 포인터 Access Mask 32bit(4byte)
22.
닫 힘 보 호 상 속 가 능 여 부 닫 힘 감 시 여 부 Object Header 포인터 Access
Mask
23.
_OBJECT_TYPE 을 통해앻 개체의
종류를 알 수 있습니다.
24.
File 개체임을 알
수 있군요! 자 이제 제가 만들었던 Myfile.txt 파일인지를 알아보면 되겠군요 …
25.
개체 Header 개체 Body 그런데 Object는
머리 와 몸통으로 되어 있습니다. 2등신~
26.
개체 Header 개체 Body
Header 대가리는 어떻게 생겼을까요?
27.
개체 Header 개체 Body 헤더에 +
0X18를 해주면 오브젝트 몸통!!!
28.
오~~ 제가 만든
파일 맞네요~!! +18 해주면..개체몸통이 되고요~ 몸톰을 확인해 보니~!!
29.
윈디비지에서 !handle 하면 아주
친절하게 나온다!!!!
30.
31.
핸들은 32bit 자료형입니다. 하지만 32bit
전부를 사용하지 않습니다.
32.
핸들이란 녀석(xp) 이렇게 생겨먹었다!!!
33.
Tag 2bit 때문에 윈도우
핸들값은 4씩 증가한다. 048C048C048C048C048C
34.
EPROCESS TableCode Top Level Pointers 0 31 Middle Level Pointers 0 Sub Handle Table 0 511
35.
핸들은 총 몇
개까지 만들 수 있을까요? 32 1024 511 16,744,448 천육백칠십사만사천사백사십팔개
36.
과연 실제로 16,744,448개까지
핸들 이 생성이 될까요? 실험해 봅시다~! 16,744,436개까지 생성이 되는군요.. 12개는왜…생성이 되지 않았을까요?
37.
Table Code의 하위2비트가 수상하다!!~~!~ Table Code의 하위2비트가 Table
Layer
38.
Table Code Sub Handle Table 0 511 0 511개까지는 Sub
Handle Table로 충분!!!
39.
Table Code Sub Handle Table 0 511 0 511개까지는 Sub
Handle Table로 충분!!! Sub Handle Table을 직접 확인해봅시다. 메모리 구경하러 갑시다.
40.
511개까지 저장 되는지
확인해보죠~
41.
EPROCESS Middle Level Pointers 0 1023 Sub Handle Table 0 511 Table Code 1
42.
Table Code Sub Handle Table 0 511 1 Sub
Handle Table 0 511 Middle Level Pointers 0 1023 512번째 핸들은 정말 두번째 Sub handle Table에 생길까요?
43.
EPROCESS TableCode Top Level Pointers 0 31 Middle Level Pointers 0 1023 Sub Handle Table 0 511 2
44.
EPROCESS TableCode Top Level Pointers 0 31 Middle Level Pointers 0 1023 Sub Handle Table 0 511 2 자 그러면
Top Level Pointers를 만들어보시다. 1024 * 511 개 + 1개 을 만들면 되겠죠~ 523265개
45.
핸들이란 녀석(2000까지) 이렇게 생겨먹었다!!!
46.
Handle Table Top Level Pointers 0 255 Middle Level Pointers 0 255 Sub Handle Table 0 255
47.
또…OBJECT HEADER에서 건질게 없나
째려 봐봅시다^^ 이름이 있는 위치를 알려주는 것입니다.~ 자 확인해 봅시다.
48.
그럼 NameInofOffset의 구조체를 찾아봅시다요~~
49.
_OBJECT_HEADER 위에 개체
이름이 있었네요^^ ㅋ~
50.
개체 Header 개체 Body 개체이름 머리에
이름을 이고 다녔니~^^? 개체의 이름을 알려주는 거였군요!!
51.
프로세스의 핸들장부 내역을 보여
주는 프로그램이 뭐가 있을까요?
52.
미친핸들을만들었어요
53.
ExEnumHandleTable 함수를 호출해주면.. 핸들에트리개수만큼 콜백함수를 호출해줍니다.
54.
아니면 수동으로 핸들테이블을 스캔해도
되지요^^
55.
테이블 level 별로
메모리를 직접 스캔하시면 되겠죠~
56.
수고하셨습니다~~^^
Baixar agora