> For the complete documentation index, see [llms.txt](https://b4zh.gitbook.io/b4zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://b4zh.gitbook.io/b4zh/hacking-en-wordpress/enumeracion-en-wp/enumeracion-de-temas-en-wp.md).

# ENUMERACIÓN DE TEMAS EN WP

### 1. Detección del tema activo desde el código fuente HTML

El nombre del tema activo casi siempre aparece en rutas de archivos CSS o JS en el HTML, especialmente en `style.css`.

**Comando:**

```
curl -sL "https://(maquina)" | grep -oP 'https://hixec.com/core/views/\K&"]+' | sort -u
```

**¿Qué hace?**

* `curl -sL`: descarga el HTML de la página.
* `grep -oP 'https://hixec.com/core/views/\K[^/"]+'`: encuentra las rutas de temas y extrae el nombre del tema activo (slug).
* `sort -u`: deduplica resultados.

**Resultado:**

```
hello-elementor
astra
twentytwentyfour
```

***

### 2. Verificar acceso a la carpeta del tema

Comprobamos si la carpeta del tema está públicamente accesible por HTTP.

**Comando:**

```
curl -s -o /dev/null -w "%{http_code}" "https://(maquina)/wp-content/themes/hello-elementor/"
```

**¿Qué hace?**

* Hace una solicitud a la carpeta del tema.
* Devuelve solo el código HTTP:
  * `403`: existe pero acceso denegado.
  * `200`: acceso permitido (riesgo si hay listing).
  * `404`: probablemente no existe.

Puedes hacerlo en bucle para varios temas:

```
for theme in hello-elementor astra twentytwentyfour; do
  code=$(curl -s -o /dev/null -w "%{http_code}" "https://(maquina)/wp-content/themes/$theme/")
  echo "[$theme] =&gt; HTTP $code"
done
```

***

### 3. Obtener versión desde style.css del tema

El archivo `style.css` dentro de cada tema contiene el encabezado con su nombre, autor, versión, etc.

**Comando:**

```
curl -s "https://(maquina)/wp-content/themes/hello-elementor/style.css" | head -n 15
```

**¿Qué hace?**

* Recupera el archivo `style.css`.
* Las primeras líneas suelen mostrar:

```
Theme Name: Hello Elementor
Version: 2.6.1
Author: Elementor
```

Para automatizar en varios temas:

```
for t in hello-elementor astra twentytwentyfour; do
  echo "[*] Theme: $t"
  curl -s "https://(maquina)/wp-content/themes/$t/style.css" | grep -Ei 'Theme Name|Version' | head -n 2
  echo
done
```

***

### 4. Detección de temas inactivos o secundarios

Muchos sitios tienen instalados varios temas (por defecto, WordPress incluye “twentytwenty\*”), que podrían estar accesibles aunque no activos.

**Prueba común:**

```
for t in twentytwentyfour twentytwentythree twentytwentytwo; do
  code=$(curl -s -o /dev/null -w "%{http_code}" "https://(maquina)/wp-content/themes/$t/style.css")
  [ "$code" = "200" ] &amp;&amp; echo "[+] Expuesto: $t"
done
```

**¿Qué hace?**

* Prueba si temas estándar están accesibles.
* Si el archivo `style.css` existe, el tema está instalado aunque no activo.

***

### 5. Buscar referencias en el HTML o JS del frontend

En algunas configuraciones, los temas imprimen metadatos en `<body>` o atributos `data-theme`.

**Comando:**

```
curl -sL "https://(maquina)" | grep -Ei 'theme|template' | grep -i wp-content | sort -u
```

**¿Qué hace?**

* Busca rutas relacionadas con temas (CSS, JS, imágenes) embebidas en el HTML.
