
Windows CLFS LPE exploit PoC für Sicherheitsforschung
CVE-2025-60709 es una vulnerabilidad de escalación de privilegios locales (LPE) en el controlador CLFS.sys (Common Log File System) de Windows. Permite a un atacante con ejecución de código local escalar desde usuario estándar hasta NT AUTHORITY\SYSTEM mediante un buffer overflow en el parsing de contenedores CLFS, obteniendo una primitiva de escritura arbitraria en memoria del kernel.
Este repositorio contiene dos implementaciones:
| Campo | Detalle |
|---|---|
| CVE ID | CVE-2025-60709 |
| Tipo | Local Privilege Escalation (LPE) |
| Componente | CLFS.sys (Common Log File System driver) |
| Sistema objetivo | Windows 11 24H2 (build 26100.3485+) |
| Arquitectura | x64 únicamente |
| Vector | Buffer overflow en parsing de contenedor CLFS |
| Impacto | Escalación a NT AUTHORITY\SYSTEM |
| Prerequisitos | Ejecución local de código (usuario estándar) |
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
| Campo | Offset | Descripción |
|---|---|---|
EPROCESS_TOKEN | 0x4C0 | Token de seguridad del proceso |
EPROCESS_PID | 0x440 | Process ID (PID) |
EPROCESS_LINKS | 0x448 | Lista enlazada de procesos activos |
EPROCESS_NAME | 0x5A8 | Nombre del proceso (ImageFileName) |
⚠️ Estos offsets varían entre builds de Windows. Requieren actualización para otras versiones.
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| Función | Propósito |
|---|---|
GetKernelBase() | ZwQuerySystemInformation(SystemModuleInformation) → base de ntoskrnl.exe |
KillETW() | VirtualProtect + sobreescribe EtwEventWrite en ntdll.dll con 0xC3 (RET) |
KillAMSI() | Carga amsi.dll + sobreescribe AmsiScanBuffer con 0xC3 (RET) |
GroomLookaside() | Crea 4096 logs CLFS para exhaust de lookaside lists → heap determinista |
ClfsArbWrite() | Núcleo del exploit — primitiva de escritura arbitraria en kernel |
main() | Orquesta ataque: ETW→AMSI→groom→token theft→arb write→beacon |
| Aspecto | Versión C | Versión Go |
|---|---|---|
| Tipo | Exploit funcional (según documentación) | Demo educativa únicamente |
| APIs | Acceso directo (ntdll, clfsw32, advapi32) | syscall.NewLazyDLL() wrappers |
| Checksum CLFS | Algoritmo completo | Placeholder simplificado |
| Direcciones kernel | Reales | Hardcoded placeholder (0x123456) |
| Payload C2 | Shellcode 1789 bytes | Bytes NOP (0x90) de prueba |
| Resultado esperado | Escalación a SYSTEM | Mensaje "Arb write failed (yeah)" |
Versión C (requiere Visual Studio Build Tools + Windows SDK):
cl /O1 /MT /link ntdll.lib advapi32.lib clfsw32.lib CVE-2025-60709.c
Versión Go (requiere Go 1.19+ en Windows x64):
go build -ldflags="-s -w" -o CVE-2025-60709.exe CVE-2025-60709.go
| Mitigación | Efectividad |
|---|---|
| HVCI (Hypervisor-protected Code Integrity) | Alta — previene escritura en memoria kernel |
| kCFI (Kernel Control Flow Integrity) | Alta — dificulta ROP/JOP chains |
| CFG (Control Flow Guard) | Media — dificulta ejecución de shellcode |
| Windows Defender | Media — detecta técnicas conocidas |
| Actualización Windows | Alta — parche oficial elimina la vulnerabilidad |
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
}
| Tipo | Valor |
|---|---|
| Archivo malformado | C:\Windows\Temp\evil.blf |
| Log malformado | \\.\C:\Windows\Temp\evil_log |
| Archivos grooming | C:\Windows\Temp\groom_00000.blf … groom_04095.blf |
| Proceso | Alta prioridad (REALTIME_PRIORITY_CLASS) anómala |
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 ist eine Lokale Rechteausweitung (LPE)-Schwachstelle im Windows-Treiber CLFS.sys (Common Log File System). Sie ermöglicht einem Angreifer mit lokaler Codeausführung die Eskalation von einem Standardbenutzer zu NT AUTHORITY\SYSTEM durch einen Pufferüberlauf bei der Analyse von CLFS-Containern, wodurch eine primitive Schreiboperation in den Kernel-Speicher erlangt wird.
Dieses Repository enthält zwei Implementierungen:
| Feld | Detail |
|---|---|
| CVE-ID | CVE-2025-60709 |
| Typ | Lokale Rechteausweitung (LPE) |
| Komponente | CLFS.sys (Common Log File System-Treiber) |
| Zielbetriebssystem | Windows 11 24H2 (Build 26100.3485+) |
| Architektur | nur x64 |
| Vektor | Pufferüberlauf bei der CLFS-Container-Analyse |
| Auswirkung | Eskalation zu NT AUTHORITY\SYSTEM |
| Voraussetzungen | Lokale Codeausführung (Standardbenutzer) |
[1] UMGEHUNG VON SCHUTZMECHANISMEN
├─ KillETW() → Patche EtwEventWrite in ntdll mit RET (0xC3)
└─ KillAMSI() → Patche AmsiScanBuffer in amsi.dll mit RET (0xC3)
[2] HEAP-GROOMING
└─ GroomLookaside()
├─ Erstellt 4096 Dateien: C:\Windows\Temp\groom_00000.blf
├─ Ruft CreateLogFile() + AddLogContainer() für jede auf
└─ Erschöpft Lookaside-Listen → garantiert vorhersagbares Heap-Layout
[3] ARBITRÄRE SCHREIBPRIMITIVE — ClfsArbWrite(Address, Value)
├─ Konstruiert fehlerhaften CLFS-Puffer (0x102010 Bytes)
│ ├─ Gültige CLFS-Signatur bei +0x00: 0x0201
│ ├─ Überdimensioniertes cbRecord bei +0x100: 0xFF00 (65.280 Bytes)
│ ├─ Shadow-Zone-Marker bei +0x9A8: 0x13371337
│ └─ Gefälschter CClfsContainerContext bei Offset (0xFF00 + 0x100):
│ ├─ pContainer = TargetAddress - 0x10
│ └─ cbContainer = Value (zu schreibende Daten)
├─ Berechnet gültige CLFS-Prüfsumme (Treiber validiert)
├─ Schreibt fehlerhaften Container → C:\Windows\Temp\evil.blf
├─ Erstellt Log, das auf evil.blf verweist
├─ Ruft ClfsReadRestartArea() auf → löst Kernel-Parsing aus
└─ Treiber überläuft Puffer → schreibt Value an Address ✓
[4] SYSTEM-TOKEN-DIEBSTAHL
├─ Liest EPROCESS des SYSTEM-Prozesses über PsInitialSystemProcess
└─ Extrahiert Token bei EPROCESS + 0x4C0
[5] RECHTERHÖHUNG
└─ ClfsArbWrite(CurrentEprocess + 0x4C0, SystemToken)
└─ Überschreibt aktuelles Prozesstoken mit SYSTEM-Token ✓
[6] C2-PAYLOAD-AUSFÜHRUNG
├─ VirtualAlloc(PAGE_EXECUTE_READWRITE)
├─ Kopiere 1789-Byte-Shellcode-Beacon
├─ CreateThread() → läuft als NT AUTHORITY\SYSTEM
└─ Beacon: IPv6 + DoH C2 → Gmail-Drafts als Fallback
└─ sRDI + Sleep-Obfuskation + ETW/AMSI bereits gepatcht
[7] PERSISTENZ
└─ Sleep(INFINITE) → Prozess behält SYSTEM-Token
| Feld | Offset | Beschreibung |
|---|---|---|
EPROCESS_TOKEN | 0x4C0 | Prozess-Sicherheitstoken |
EPROCESS_PID | 0x440 | Prozess-ID |
EPROCESS_LINKS | 0x448 | Liste aktiver Prozesse |
EPROCESS_NAME | 0x5A8 | Prozessname (ImageFileName) |
⚠️ Diese Offsets variieren zwischen Windows-Builds. Müssen für andere Versionen aktualisiert werden.
Legitimer CLFS-Container:
[0x100 Byte Header][Record: cbRecord Bytes echter Daten]
Fehlerhafter Container (evil.blf):
[Gültiger Header][cbRecord=0xFF00 → Kernel liest 65.280 Bytes]
↓
Kernel überläuft → erreicht gefälschten CClfsContainerContext
↓
pContainer = TargetKernelAddress - 0x10
cbContainer = ValueToWrite
↓
Treiber verwendet gefälschte Struktur → schreibt ValueToWrite an TargetKernelAddress
CVE-2025-60709.c| Funktion | Zweck |
|---|---|
GetKernelBase() | ZwQuerySystemInformation(SystemModuleInformation) → ntoskrnl.exe-Basis |
KillETW() | VirtualProtect + Überschreiben von EtwEventWrite in ntdll.dll mit 0xC3 (RET) |
KillAMSI() | Laden von amsi.dll + Überschreiben von AmsiScanBuffer mit 0xC3 (RET) |
GroomLookaside() | Erstellen von 4096 CLFS-Logs, um Lookaside-Listen zu erschöpfen → deterministischer Heap |
ClfsArbWrite() | Exploit-Kern – primitive Schreiboperation in den Kernel-Speicher |
main() | Orchestriert Angriff: ETW→AMSI→Groom→Token-Diebstahl→ArbWrite→Beacon |
| Aspekt | C-Version | Go-Version |
|---|---|---|
| Typ | Funktionaler Exploit (laut Dokumentation) | Nur Bildungsdemo |
| APIs | Direkt (ntdll, clfsw32, advapi32) | syscall.NewLazyDLL()-Wrapper |
| CLFS-Prüfsumme | Vollständiger Algorithmus | Vereinfachter Platzhalter |
| Kernel-Adressen | Echt | Hardcodierter Platzhalter (0x123456) |
| C2-Payload | 1789-Byte-Shellcode | NOP-Bytes (0x90) |
| Erwartetes Ergebnis | SYSTEM-Eskalation | Meldung "Arb write failed (yeah)" |
C-Version (erfordert Visual Studio Build Tools + Windows SDK):
cl /O1 /MT /link ntdll.lib advapi32.lib clfsw32.lib CVE-2025-60709.c
Go-Version (erfordert Go 1.19+ auf Windows x64):
go build -ldflags="-s -w" -o CVE-2025-60709.exe CVE-2025-60709.go
| Maßnahme | Wirksamkeit |
|---|---|
| HVCI (Hypervisor-geschützte Codeintegrität) | Hoch – verhindert Schreibvorgänge in den Kernel-Speicher |
| kCFI (Kernel Control Flow Integrity) | Hoch – blockiert ROP/JOP-Ketten |
| CFG (Control Flow Guard) | Mittel – erschwert Shellcode-Ausführung |
| Windows Defender | Mittel – erkennt bekannte Techniken |
| Windows Update | Hoch – offizieller Patch beseitigt die Schwachstelle |
rule CVE_2025_60709_CLFS_LPE {
meta:
description = "Erkennt 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
}
| Typ | Wert |
|---|---|
| Fehlerhafte Datei | C:\Windows\Temp\evil.blf |
| Fehlerhaftes Log | \\.\C:\Windows\Temp\evil_log |
| Grooming-Dateien | C:\Windows\Temp\groom_00000.blf … groom_04095.blf |
| Prozess | Anomale REALTIME_PRIORITY_CLASS-Priorität |
DATEI: Massenhafte Erstellung von *.blf in C:\Windows\Temp\ (> 100 in Sekunden)
DATEI: Erstellung von C:\Windows\Temp\evil.blf
PROZESS: REALTIME_PRIORITY-Prozess + ClfsReadRestartArea-Aufrufe
SPEICHER: Schreiben in PAGE_EXECUTE_READWRITE + sofortiger CreateThread
API: VirtualProtect über EtwEventWrite oder AmsiScanBuffer
KERNEL: Zugriff auf PsInitialSystemProcess aus dem Benutzermodus
# Grooming-Dateien prüfen
Get-ChildItem C:\Windows\Temp -Filter "groom_*.blf" | Measure-Object
# Exploit-Datei prüfen
Test-Path C:\Windows\Temp\evil.blf
DE: Dieser Exploit-PoC wird ausschließlich für Sicherheitsforschung, Schwachstellenanalyse, Bedrohungsanalyse und defensive Zwecke veröffentlicht. Die Verwendung dieses Codes gegen Systeme ohne ausdrückliche schriftliche Genehmigung ist illegal und kann gegen den CFAA, Computer Misuse Act und entsprechende Gesetze verstoßen. Die Autoren übernehmen keine Haftung für Missbrauch.
ES: Este PoC de exploit se publica únicamente para investigación de seguridad, análisis de vulnerabilidades, inteligencia de amenazas y fines defensivos. Usar este código contra sistemas sin autorización escrita explícita es ilegal y puede violar el CFAA, Computer Misuse Act y legislación equivalente. Los autores no asumen responsabilidad por el uso indebido.