Soumettre la recherche
Mettre en ligne
Windows handle 의 비밀 2
•
9 j'aime
•
7,052 vues
Joosaeng Kim
Suivre
Windows Handle 의 비밀 Windows Handle의 역할 및 커널 내부 구조에 대한 여러 실험한 내용을 공유한다.
Lire moins
Lire la suite
Technologie
Signaler
Partager
Signaler
Partager
1 sur 56
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson56
Azure DevOps & GitHub... Better Together!
Azure DevOps & GitHub... Better Together!
Lorenzo Barbieri
The history of Prometheus at SoundCloud
The history of Prometheus at SoundCloud
Tobias Schmidt
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
Simplilearn
DevSecOps: Key Controls for Modern Security Success
DevSecOps: Key Controls for Modern Security Success
Puma Security, LLC
Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open Source
NGINX, Inc.
Devops
Devops
Daniel Fikre
Recommandé
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson56
Azure DevOps & GitHub... Better Together!
Azure DevOps & GitHub... Better Together!
Lorenzo Barbieri
The history of Prometheus at SoundCloud
The history of Prometheus at SoundCloud
Tobias Schmidt
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
Simplilearn
DevSecOps: Key Controls for Modern Security Success
DevSecOps: Key Controls for Modern Security Success
Puma Security, LLC
Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open Source
NGINX, Inc.
Devops
Devops
Daniel Fikre
DevOps Monitoring and Alerting
DevOps Monitoring and Alerting
Khairul Zebua
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
Infrastructure as Code for Azure: ARM or Terraform?
Infrastructure as Code for Azure: ARM or Terraform?
Katherine Golovinova
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Vietnam Open Infrastructure User Group
Subversion
Subversion
University of Texas at Dallas
Software architecture for high traffic website
Software architecture for high traffic website
Tung Nguyen Thanh
The Mono-repo – a contradiction with Microservices
The Mono-repo – a contradiction with Microservices
Eficode
Distributed Locking in Kubernetes
Distributed Locking in Kubernetes
Rafał Leszko
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Nikhil Thomas
Devops
Devops
Fernando Ike
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
Red Hat Developers
OpenTelemetry: From front- to backend (2022)
OpenTelemetry: From front- to backend (2022)
Sebastian Poxhofer
Angular 4 - Introdução
Angular 4 - Introdução
Jackson Veroneze
Git hub ppt presentation
Git hub ppt presentation
AyanaRukasar
Build pipelines with bitbucket for Magento
Build pipelines with bitbucket for Magento
Rrap Software Pvt Ltd
코틀린 멀티플랫폼, 미지와의 조우
코틀린 멀티플랫폼, 미지와의 조우
Arawn Park
Domain-Driven Design in der Praxis
Domain-Driven Design in der Praxis
Michael Mirold
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
(NEMO-UX) WAYLAND 기반 윈도우 매니저 소개
nemoux
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
nemoux
Contenu connexe
Tendances
DevOps Monitoring and Alerting
DevOps Monitoring and Alerting
Khairul Zebua
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
Infrastructure as Code for Azure: ARM or Terraform?
Infrastructure as Code for Azure: ARM or Terraform?
Katherine Golovinova
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Vietnam Open Infrastructure User Group
Subversion
Subversion
University of Texas at Dallas
Software architecture for high traffic website
Software architecture for high traffic website
Tung Nguyen Thanh
The Mono-repo – a contradiction with Microservices
The Mono-repo – a contradiction with Microservices
Eficode
Distributed Locking in Kubernetes
Distributed Locking in Kubernetes
Rafał Leszko
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Nikhil Thomas
Devops
Devops
Fernando Ike
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
Red Hat Developers
OpenTelemetry: From front- to backend (2022)
OpenTelemetry: From front- to backend (2022)
Sebastian Poxhofer
Angular 4 - Introdução
Angular 4 - Introdução
Jackson Veroneze
Git hub ppt presentation
Git hub ppt presentation
AyanaRukasar
Build pipelines with bitbucket for Magento
Build pipelines with bitbucket for Magento
Rrap Software Pvt Ltd
코틀린 멀티플랫폼, 미지와의 조우
코틀린 멀티플랫폼, 미지와의 조우
Arawn Park
Domain-Driven Design in der Praxis
Domain-Driven Design in der Praxis
Michael Mirold
Tendances
(20)
DevOps Monitoring and Alerting
DevOps Monitoring and Alerting
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Infrastructure as Code for Azure: ARM or Terraform?
Infrastructure as Code for Azure: ARM or Terraform?
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Subversion
Subversion
Software architecture for high traffic website
Software architecture for high traffic website
The Mono-repo – a contradiction with Microservices
The Mono-repo – a contradiction with Microservices
Distributed Locking in Kubernetes
Distributed Locking in Kubernetes
Git Lab Introduction
Git Lab Introduction
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Devops
Devops
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
OpenTelemetry: From front- to backend (2022)
OpenTelemetry: From front- to backend (2022)
Angular 4 - Introdução
Angular 4 - Introdução
Git hub ppt presentation
Git hub ppt presentation
Build pipelines with bitbucket for Magento
Build pipelines with bitbucket for Magento
코틀린 멀티플랫폼, 미지와의 조우
코틀린 멀티플랫폼, 미지와의 조우
Domain-Driven Design in der Praxis
Domain-Driven Design in der Praxis
En vedette
(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
En vedette
(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 로 옮겨가기
Similaire à 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
Similaire à 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.
수고하셨습니다~~^^
Télécharger maintenant