🚨 エクスプロイト PoC — セキュリティ研究、脆弱性分析、および防御目的のみ
🚨 エクスプロイト PoC — セキュリティ研究、脆弱性分析、および防御目的のみ
🌐 言語 / Languages
🇪🇸 スペイン語ドキュメント
概要
CVE-2025-60709 は、Windows の CLFS.sys(Common Log File System)ドライバーにおける**ローカル権限昇格(LPE)**の脆弱性です。ローカルでコード実行が可能な攻撃者が、CLFS コンテナのパース処理におけるバッファオーバーフローを利用して、標準ユーザーから NT AUTHORITY\SYSTEM へ権限を昇格させ、カーネルメモリへの任意書き込みプリミティブを取得できます。
このリポジトリには2つの実装が含まれています:
- CVE-2025-60709.c — C によるオリジナル実装(Windows ネイティブ API への直接アクセス)
- CVE-2025-60709.go — Go による移植版**(デモ/教育用バージョン — 実際の脆弱性は悪用しません)**
🎯 脆弱性の詳細
🏗️ リポジトリ構成
CVE-2025-60709/
├── CVE-2025-60709.c (5.3 KB, 157 líneas) — Exploit C original
├── CVE-2025-60709.go (9.2 KB, 285 líneas) — Port Go (demo educativa)
└── README.txt (4.2 KB, 132 líneas) — Documentación original
🔬 詳細な技術分析
完全なエクスプロイトの流れ
┌─────────────────────────────────────────────────────────────┐
│ CVE-2025-60709 LPE │
└─────────────────────────────────────────────────────────────┘
[1] EVASIÓN DE DEFENSAS
├─ KillETW() → Parchea EtwEventWrite en ntdll con RET (0xC3)
└─ KillAMSI() → Parchea AmsiScanBuffer en amsi.dll con RET (0xC3)
[2] HEAP GROOMING (preparación de memoria)
└─ GroomLookaside()
├─ Crea 4096 archivos: C:\Windows\Temp\groom_00000.blf
├─ Llama CreateLogFile() + AddLogContainer() por cada uno
└─ Agota lookaside lists → garantiza layout de heap predecible
[3] PRIMITIVA DE ESCRITURA ARBITRARIA — ClfsArbWrite(Address, Value)
├─ Construye buffer CLFS malformado (0x102010 bytes)
│ ├─ Firma válida CLFS en +0x00: 0x0201
│ ├─ Sector size shift en +0x14: 2
│ ├─ First client region en +0x28: 0x100
│ ├─ cbRecord OVERSIZED en +0x100: 0xFF00 (64 KB > datos reales)
│ ├─ Marcador shadow zone en +0x9A8: 0x13371337
│ └─ CClfsContainerContext falso en offset (0xFF00 + 0x100):
│ ├─ pContainer = TargetAddress - 0x10
│ └─ cbContainer = Value (dato a escribir)
├─ Calcula checksum CLFS correcto (driver lo valida)
├─ Escribe contenedor malformado → C:\Windows\Temp\evil.blf
├─ Crea log apuntando a evil.blf
├─ Llama ClfsReadRestartArea() → dispara parsing kernel
└─ Driver desborda buffer → escribe Value en Address ✓
[4] ROBO DE TOKEN SYSTEM
├─ Lee EPROCESS del proceso SYSTEM via PsInitialSystemProcess
└─ Extrae token en EPROCESS + EPROCESS_TOKEN (offset 0x4c0)
[5] ESCALACIÓN DE PRIVILEGIOS
└─ ClfsArbWrite(CurrentEprocess + 0x4c0, SystemToken)
└─ Sobreescribe token del proceso actual con token SYSTEM ✓
[6] EJECUCIÓN DE PAYLOAD C2
├─ VirtualAlloc(PAGE_EXECUTE_READWRITE)
├─ Copia shellcode beacon de 1789 bytes
├─ CreateThread() → ejecución como NT AUTHORITY\SYSTEM
└─ Beacon C2: IPv6 + DoH → fallback Gmail drafts
└─ sRDI + sleep obfuscation + ETW/AMSI ya parcheados
[7] PERSISTENCIA
└─ Sleep(INFINITE) → proceso mantiene token SYSTEM
EPROCESS オフセット(Windows 11 24H2 ビルド 26100.3485+)
⚠️ これらのオフセットは Windows ビルドによって異なります。 他のバージョンでは更新が必要です。
CLFS におけるバッファオーバーフローの仕組み
Contenedor CLFS legítimo:
[Header 0x100 bytes][Record: cbRecord bytes de datos reales]
Contenedor malformado (evil.blf):
[Header válido][cbRecord=0xFF00 → kernel lee 65,280 bytes]
↓
Kernel overflow → llega a CClfsContainerContext falso
↓
pContainer = TargetKernelAddress - 0x10
cbContainer = ValueToWrite
↓
Driver usa estructura falsa → escribe ValueToWrite en TargetKernelAddress
主要関数 — CVE-2025-60709.c
C と Go の違い
ビルド
C 版(Visual Studio Build Tools + Windows SDK が必要):
cl /O1 /MT /link ntdll.lib advapi32.lib clfsw32.lib CVE-2025-60709.c
Go 版(Windows x64 で Go 1.19+ が必要):
go build -ldflags="-s -w" -o CVE-2025-60709.exe CVE-2025-60709.go
🛡️ 緩和策と検出
Windows の緩和策
YARA ルール
rule CVE_2025_60709_CLFS_LPE {
meta:
description = "Detects CVE-2025-60709 CLFS LPE exploit"
author = "KONDORDEVSECURITYCORP"
date = "2026-03"
cve = "CVE-2025-60709"
severity = "critical"
strings:
$clfs_sig = { 01 02 00 00 }
$magic = { 37 13 37 13 }
$evil_file = "evil.blf" ascii wide
$groom_file = "groom_" ascii wide
$etw_func = "EtwEventWrite" ascii wide
$amsi_func = "AmsiScanBuffer" ascii wide
$token_off = { C0 04 00 00 } // EPROCESS_TOKEN = 0x4C0
condition:
3 of them
}
IOC — システムのアーティファクト
動作ベースの検出
ARCHIVO: Creación masiva de *.blf en C:\Windows\Temp\ (> 100 en segundos)
ARCHIVO: Creación de C:\Windows\Temp\evil.blf
PROCESO: Proceso en modo REALTIME_PRIORITY + llamadas a ClfsReadRestartArea
MEMORIA: Escritura en PAGE_EXECUTE_READWRITE + CreateThread inmediato
API: VirtualProtect sobre EtwEventWrite o AmsiScanBuffer
KERNEL: Acceso a PsInitialSystemProcess desde user-mode
クイック検証
# Verificar archivos de grooming
Get-ChildItem C:\Windows\Temp -Filter "groom_*.blf" | Measure-Object
# Verificar archivo exploit
Test-Path C:\Windows\Temp\evil.blf
# Verificar integridad de ntdll (ETW patch)
Get-AuthenticodeSignature (Get-Process -Name notepad | Select -First 1).Path
🇬🇧 英語ドキュメント
概要
CVE-2025-60709 は、Windows の CLFS.sys(Common Log File System)ドライバーにおける**ローカル権限昇格(LPE)**の脆弱性です。ローカルでコード実行が可能な攻撃者が、CLFS コンテナのパース処理におけるバッファオーバーフローを利用して、標準ユーザーから NT AUTHORITY\SYSTEM へ権限を昇格させ、カーネルメモリへの任意書き込みプリミティブを取得できます。
このリポジトリには2つの実装が含まれています:
- CVE-2025-60709.c — オリジナルの C 実装(Windows ネイティブ API への直接アクセス)
- CVE-2025-60709.go — Go 移植版**(デモ/教育用バージョン — 実際の脆弱性は悪用しません)**
🎯 脆弱性の詳細
🔬 技術分析
エクスプロイトの流れ
[1] DEFENSE EVASION
├─ KillETW() → Patch EtwEventWrite in ntdll with RET (0xC3)
└─ KillAMSI() → Patch AmsiScanBuffer in amsi.dll with RET (0xC3)
[2] HEAP GROOMING
└─ GroomLookaside()
├─ Creates 4096 files: C:\Windows\Temp\groom_00000.blf
├─ Calls CreateLogFile() + AddLogContainer() for each
└─ Exhausts lookaside lists → guarantees predictable heap layout
[3] ARBITRARY WRITE PRIMITIVE — ClfsArbWrite(Address, Value)
├─ Constructs malformed CLFS buffer (0x102010 bytes)
│ ├─ Valid CLFS signature at +0x00: 0x0201
│ ├─ Oversized cbRecord at +0x100: 0xFF00 (65,280 bytes)
│ ├─ Shadow zone marker at +0x9A8: 0x13371337
│ └─ Fake CClfsContainerContext at offset (0xFF00 + 0x100):
│ ├─ pContainer = TargetAddress - 0x10
│ └─ cbContainer = Value (data to write)
├─ Computes valid CLFS checksum (driver validates)
├─ Writes malformed container → C:\Windows\Temp\evil.blf
├─ Creates log pointing to evil.blf
├─ Calls ClfsReadRestartArea() → triggers kernel parsing
└─ Driver overflows buffer → writes Value to Address ✓
[4] SYSTEM TOKEN THEFT
├─ Reads SYSTEM process EPROCESS via PsInitialSystemProcess
└─ Extracts token at EPROCESS + 0x4C0
[5] PRIVILEGE ESCALATION
└─ ClfsArbWrite(CurrentEprocess + 0x4C0, SystemToken)
└─ Overwrites current process token with SYSTEM token ✓
[6] C2 PAYLOAD EXECUTION
├─ VirtualAlloc(PAGE_EXECUTE_READWRITE)
├─ Copy 1789-byte shellcode beacon
├─ CreateThread() → runs as NT AUTHORITY\SYSTEM
└─ Beacon: IPv6 + DoH C2 → Gmail drafts fallback
└─ sRDI + sleep obfuscation + ETW/AMSI already patched
[7] PERSISTENCE
└─ Sleep(INFINITE) → process keeps SYSTEM token
EPROCESS オフセット(Windows 11 24H2 ビルド 26100.3485+)
⚠️ これらのオフセットは Windows ビルドによって異なります。 他のバージョンでは更新が必要です。
CLFS バッファオーバーフローの仕組み
Legitimate CLFS container:
[0x100 byte Header][Record: cbRecord bytes of real data]
Malformed container (evil.blf):
[Valid Header][cbRecord=0xFF00 → kernel reads 65,280 bytes]
↓
Kernel overflows → reaches fake CClfsContainerContext
↓
pContainer = TargetKernelAddress - 0x10
cbContainer = ValueToWrite
↓
Driver uses fake structure → writes ValueToWrite to TargetKernelAddress
主要関数 — CVE-2025-60709.c
C と Go の違い
ビルド手順
C 版(Visual Studio Build Tools + Windows SDK が必要):
cl /O1 /MT /link ntdll.lib advapi32.lib clfsw32.lib CVE-2025-60709.c
Go 版(Windows x64 で Go 1.19+ が必要):
go build -ldflags="-s -w" -o CVE-2025-60709.exe CVE-2025-60709.go
🛡️ 緩和策と検出
Windows の緩和策
YARA ルール
rule CVE_2025_60709_CLFS_LPE {
meta:
description = "Detects CVE-2025-60709 CLFS LPE exploit"
author = "KONDORDEVSECURITYCORP"
date = "2026-03"
cve = "CVE-2025-60709"
severity = "critical"
strings:
$evil_file = "evil.blf" ascii wide
$groom_file = "groom_" ascii wide
$etw_func = "EtwEventWrite" ascii wide
$amsi_func = "AmsiScanBuffer" ascii wide
$magic = { 37 13 37 13 }
$token_off = { C0 04 00 00 }
condition:
3 of them
}
IOC — システムのアーティファクト
動作ベースの検出
FILE: Mass creation of *.blf in C:\Windows\Temp\ (> 100 in seconds)
FILE: Creation of C:\Windows\Temp\evil.blf
PROCESS: REALTIME_PRIORITY process + ClfsReadRestartArea calls
MEMORY: Write to PAGE_EXECUTE_READWRITE + immediate CreateThread
API: VirtualProtect over EtwEventWrite or AmsiScanBuffer
KERNEL: PsInitialSystemProcess access from user-mode
クイック検証
# Check grooming files
Get-ChildItem C:\Windows\Temp -Filter "groom_*.blf" | Measure-Object
# Check exploit file
Test-Path C:\Windows\Temp\evil.blf
📚 技術リファレンス / Technical References
⚠️ 法的通知 / Legal Notice
EN: このエクスプロイト PoC は、セキュリティ研究、脆弱性分析、脅威インテリジェンス、および防御目的のみのために公開されています。明示的な書面による許可なくこのコードをシステムに対して使用することは違法であり、CFAA、Computer Misuse Act、および同等の法律に違反する可能性があります。著者は不正使用に対する責任を負いません。
ES: このエクスプロイト PoC は、セキュリティ研究、脆弱性分析、脅威インテリジェンス、および防御目的のみのために公開されています。明示的な書面による許可なくこのコードをシステムに対して使用することは違法であり、CFAA、Computer Misuse Act、および同等の法律に違反する可能性があります。著者は不正使用に対する責任を負いません。